Draws the specified WriteableBitmap object at the specified location,
adjusting the image size as specified by the align and
stretch parameters.
Namespace:
C1.Silverlight.PdfAssembly: C1.Silverlight.Pdf (in C1.Silverlight.Pdf.dll)
Syntax
C# |
---|
public void DrawImage( WriteableBitmap img, Rect rc, ContentAlignment align, Stretch stretch ) |
Visual Basic |
---|
Public Sub DrawImage ( _ img As WriteableBitmap, _ rc As Rect, _ align As ContentAlignment, _ stretch As Stretch _ ) |
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.
- align
- Type: C1.Silverlight.Pdf..::..ContentAlignment
ContentAlignment value that specifies how the image should be aligned within the rectangle.
- stretch
- Type: System.Windows.Media..::..Stretch
Stretch value that specifies how the image should be sized to fit the 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, ContentAlignment align, ImageSizeMode mode) { DrawImage(new WriteableBitmap(e, null), rc, align, mode); } |