Image.Load

Load(string, LoadOptions)

Loads a new image from the specified file path or URL. If filePath is a file path the method just opens the file. If filePath is an URL, the method downloads the file, stores it as a temporary one, and opens it.

public static Image Load(string filePath, LoadOptions loadOptions)
ParameterTypeDescription
filePathStringThe file path or URL to load image from.
loadOptionsLoadOptionsThe load options.

Return Value

The loaded image.

See Also


Load(string)

Loads a new image from the specified file path or URL. If filePath is a file path the method just opens the file. If filePath is an URL, the method downloads the file, stores it as a temporary one, and opens it.

public static Image Load(string filePath)
ParameterTypeDescription
filePathStringThe file path or URL to load image from.

Return Value

The loaded image.

Examples

This example demonstrates the loading of an existing Image file into an instance of Aspose.Imaging.Image using file path specified

[C#]

//Create Image instance and initialize it with an existing image file from disk location
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(@"C:\temp\sample.bmp"))
{
    //do some image processing
}

See Also


Load(Stream, LoadOptions)

Loads a new image from the specified stream.

public static Image Load(Stream stream, LoadOptions loadOptions)
ParameterTypeDescription
streamStreamThe stream to load image from.
loadOptionsLoadOptionsThe load options.

Return Value

The loaded image.

See Also


Load(Stream)

Loads a new image from the specified stream.

public static Image Load(Stream stream)
ParameterTypeDescription
streamStreamThe stream to load image from.

Return Value

The loaded image.

Examples

This example demonstrates the use of System.IO.Stream objects to load an existing Image file

[C#]

//Create an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\sample.bmp", System.IO.FileMode.Open))
{
    //Create an instance of Image class and load an existing file through FileStream object by calling Load method
    using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(stream))
    {
        //do some image processing.
    }
}

See Also