Table of Contents

Method Load

Namespace
Aspose.CAD
Assembly
Aspose.CAD.dll

Load(string, LoadOptions)

Loads a new image from the specified file.

public static Image Load(string filePath, LoadOptions loadOptions)

Parameters

filePath string

The file path to load image from.

loadOptions LoadOptions

The load options.

Returns

Image

The loaded drawing.

Examples

Loads a drawing to process and unloads all related resources when dispose is called

using (var image = Aspose.CAD.Image.Load("fileName.dwg", new LoadOptions
{
    UnloadOnDispose = true
}))
{
    // process the drawing
}

Load(string)

Loads a new image from the specified file.

public static Image Load(string filePath)

Parameters

filePath string

The file path to load image from.

Returns

Image

The loaded drawing.

Examples

Loads a drawing to process

using (var image = Aspose.CAD.Image.Load("fileName.dwg"))
{
    // process the drawing
}

Load(Stream, LoadOptions)

Loads a new image from the specified stream.

public static Image Load(Stream stream, LoadOptions loadOptions)

Parameters

stream Stream

The stream to load image from.

loadOptions LoadOptions

The load options.

Returns

Image

The loaded drawing.

Examples

Loads a drawing to process from corresponding stream and unloads all related resources when dispose is called

using (var image = Aspose.CAD.Image.Load(File.OpenRead("fileName.dwg"), new LoadOptions
{
    UnloadOnDispose = true
}))
{
    // process the drawing
}

Load(Stream, string, LoadOptions)

Loads a new image from the specified stream.

public static Image Load(Stream stream, string fileName, LoadOptions loadOptions = null)

Parameters

stream Stream

The stream to load image from.

fileName string

The file name.

loadOptions LoadOptions

The load options.

Returns

Image

The loaded drawing.

Examples

Loads a drawing to process from corresponding stream

string filePath = "C:\\fileName.dgn";
string fileName = "fileName.dgn";
var ms = new MemoryStream(File.ReadAllBytes(filePath);
var image = Image.Load(ms, fileName)
    // process the drawing

Load(Stream)

Loads a new image from the specified stream.

public static Image Load(Stream stream)

Parameters

stream Stream

The stream to load image from.

Returns

Image

The loaded drawing.

Examples

Loads a drawing to process from corresponding stream

using (var image = Aspose.CAD.Image.Load(File.OpenRead("fileName.dwg"))
{
    // process the drawing
}