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)
Parameter | Type | Description |
---|---|---|
filePath | String | The file path or URL to load image from. |
loadOptions | LoadOptions | The load options. |
Return Value
The loaded image.
See Also
- class LoadOptions
- class Image
- namespace Aspose.Imaging
- assembly Aspose.Imaging
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)
Parameter | Type | Description |
---|---|---|
filePath | String | The 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
- class Image
- namespace Aspose.Imaging
- assembly Aspose.Imaging
Load(Stream, LoadOptions)
Loads a new image from the specified stream.
public static Image Load(Stream stream, LoadOptions loadOptions)
Parameter | Type | Description |
---|---|---|
stream | Stream | The stream to load image from. |
loadOptions | LoadOptions | The load options. |
Return Value
The loaded image.
See Also
- class LoadOptions
- class Image
- namespace Aspose.Imaging
- assembly Aspose.Imaging
Load(Stream)
Loads a new image from the specified stream.
public static Image Load(Stream stream)
Parameter | Type | Description |
---|---|---|
stream | Stream | The 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
- class Image
- namespace Aspose.Imaging
- assembly Aspose.Imaging