Draw a Canvas on this Canvas.
Syntax

[C#]

XRect DrawCanvas(Canvas inCanvas, double inWidth, double inHeight, DrawOptions inOptions);
XRect DrawCanvas(Canvas inCanvas, DrawOptions inOptions);
XRect DrawCanvas(Canvas inCanvas, XPoint inPos, DrawOptions inOptions);
XRect DrawCanvas(Canvas inCanvas, XRect inRect, DrawOptions inOptions);

[Visual Basic]

Function DrawCanvas(inCanvas As Canvas, inWidth As Double, inHeight As Double, inOptions As DrawOptions) As XRect
Function DrawCanvas(inCanvas As Canvas, inOptions As DrawOptions) As XRect
Function DrawCanvas(inCanvas As Canvas, inPos As XPoint, inOptions As DrawOptions) As XRect
Function DrawCanvas(inCanvas As Canvas, inRect As XRect, inOptions As DrawOptions) As XRect
Params
Name Description
inCanvas The Canvas to draw.
inWidth The Canvas width.
inHeight The Canvas height.
inOptions The draw options.
inPos The Canvas position.
inRect The Canvas rectangle.
return The drawn area.
Notes

This draws another Canvas onto this Canvas. The other Canvas is rendered to an image first and then it is added onto this Canvas. So this functionality can be achieved also via Image and DrawImage.

You can set rectangle, position or size for the canvas to be drawn. If you don't specify any of these the original Canvas size will be used and the Canvas will be positioned at 0,0.

See Also

DrawOptions

Example

Here we draw a canvas over another canvas.

[C#]Canvas canvas = new Canvas();
Canvas picture = new Canvas(Server.MapPath("rez/main.jpg"));
DrawOptions drawOpts = new DrawOptions();
canvas.DrawCanvas(picture, drawOpts);
canvas.SaveAs(Server.MapPath("Canvas_DrawCanvas_97.png"));


[Visual Basic]Dim canvas As New Canvas()
Dim picture As New Canvas(Server.MapPath("rez/main.jpg"))
Dim drawOpts As New DrawOptions()
canvas.DrawCanvas(picture, drawOpts)
canvas.SaveAs(Server.MapPath("Canvas_DrawCanvas_97.png"))



Canvas_DrawCanvas_97.png