Load an image.
Syntax

[C#]

void Load(byte[] inData, string inType, XImageLoadOptions inOptions);
void Load(Bitmap inBitmap);
void Load(Stream inStream, string inType, XImageLoadOptions inOptions);
void Load(string inPath, XImageLoadOptions inOptions);

[Visual Basic]

Sub Load(inData As Byte(), inType As String, inOptions As XImageLoadOptions)
Sub Load(inBitmap As Bitmap)
Sub Load(inStream As Stream, inType As String, inOptions As XImageLoadOptions)
Sub Load(inPath As String, inOptions As XImageLoadOptions)
Params
Name Description
inData The binary data of the image to be imported, as an array.
inType The type of image to be imported (the extension, with or without a leading dot).
inOptions The image load options.
inBitmap The image to be imported, as a Bitmap.
inStream The binary data of the image to be imported, as a stream.
inPath The image file to be imported.
Notes

Use this method when you have created an XImage using the default constructor and you want to load some image data.

When loading an image from a stream, the calling application must set the correct stream position first as ImageGlue7 will read from the current stream position to its end.

Example

Here we create an empty image and load the data later on. Do not draw an empty image onto a Canvas, you'll get an exception.

[C#]Canvas canvas = new Canvas();
XImage image = new XImage();
image.Load(Server.MapPath("rez/boat.gif"), new XImageLoadOptions());
canvas.DrawImage(image, new DrawOptions());
canvas.SaveAs(Server.MapPath("XImage_Load_76.png"));


[Visual Basic]Dim canvas As New Canvas()
Dim image As New XImage()
image.Load(Server.MapPath("rez/boat.gif"), New XImageLoadOptions())
canvas.DrawImage(image, New DrawOptions())
canvas.SaveAs(Server.MapPath("XImage_Load_76.png"))



XImage_Load_76.png