Type Default Value Read Only Static Description
XRect Entire image. No No The selected portion of the image.
Notes

When you are drawing an image into a Canvas ImageGlue assumes that you want to draw the whole of that image. But sometimes you may want to draw only a small part of the image. You can use this parameter to specify the part of the image you would like drawn.

Example

Here we draw an image that has been cropped of 10 pixels on every side. We assume the image is bigger than 20x20.

Note that when auto-sizing the Canvas, we use the image bounding box, not the image selection. So the Canvas is bigger than what is actually drawn. Set the desired Canvas size manually if this is not what you want.

[C#]Canvas canvas = new Canvas();
XImage image = XImage.FromFile(Server.MapPath("rez/boat.gif"));
DrawOptions drawOpts = new DrawOptions();
drawOpts.Selection = new XRect(10, 10, image.Width - 20, image.Height - 20);
canvas.DrawImage(image, drawOpts);
canvas.SaveAs(Server.MapPath("DrawOptions_Selection_77.png"));


[Visual Basic]Dim canvas As New Canvas()
Dim image As XImage = XImage.FromFile(Server.MapPath("rez/boat.gif"))
Dim drawOpts As New DrawOptions()
drawOpts.Selection = New XRect(10, 10, image.Width - 20, image.Height - 20)
canvas.DrawImage(image, drawOpts)
canvas.SaveAs(Server.MapPath("DrawOptions_Selection_77.png"))



DrawOptions_Selection_77.png