Draws the specified WriteableBitmap object at the specified location, clipping the output to the given clipping rectangle.

Namespace:  C1.Silverlight.Pdf
Assembly:  C1.Silverlight.Pdf (in C1.Silverlight.Pdf.dll)

Syntax

C#
public void DrawImage(
	WriteableBitmap img,
	Rect rc,
	Rect rcClip
)
Visual Basic
Public Sub DrawImage ( _
	img As WriteableBitmap, _
	rc As Rect, _
	rcClip As Rect _
)

Parameters

img
Type: System.Windows.Media.Imaging..::..WriteableBitmap
WriteableBitmap object to draw.
rc
Type: System.Windows..::..Rect
Rect structure that specifies the location of the drawn image, in points from the top left corner of the page.
rcClip
Type: System.Windows..::..Rect
Rect structure that specifies a clipping rectangle on the page. No part of the image is drawn outside the clipping rectangle.

Examples

The code below shows how you can use the DrawImage method can be used to render any UIElement. The code creates a WriteableBitmap from the element, then calls the DrawImage method:
Copy CodeC#
void DrawImage(UIElement e, Rect rc, Rect rcClip)
{
  DrawImage(new WriteableBitmap(e, null), rc, rcClip);
}

See Also