PDF for UWP | ComponentOne
C1.Xaml.Pdf Namespace / C1PdfDocument Class / DrawImage Method / DrawImage(WriteableBitmap,Rect,Rect) Method
Windows.UI.Xaml.Media.Imaging.WriteableBitmap object to draw.
Windows.Foundation.Rect structure that specifies the location of the drawn image, in points from the top left corner of the page.
Windows.Foundation.Rect structure that specifies a clipping rectangle on the page. No part of the image is drawn outside the clipping rectangle.
Example

In This Topic
    DrawImage(WriteableBitmap,Rect,Rect) Method
    In This Topic
    Draws the specified Windows.UI.Xaml.Media.Imaging.WriteableBitmap object at the specified location, clipping the output to the given clipping rectangle.
    Syntax
    'Declaration
     
    
    Public Overloads Sub DrawImage( _
       ByVal img As WriteableBitmap, _
       ByVal rc As Rect, _
       ByVal rcClip As Rect _
    ) 
    public void DrawImage( 
       WriteableBitmap img,
       Rect rc,
       Rect rcClip
    )

    Parameters

    img
    Windows.UI.Xaml.Media.Imaging.WriteableBitmap object to draw.
    rc
    Windows.Foundation.Rect structure that specifies the location of the drawn image, in points from the top left corner of the page.
    rcClip
    Windows.Foundation.Rect structure that specifies a clipping rectangle on the page. No part of the image is drawn outside the clipping rectangle.
    Example
    The code below shows how you can use the DrawImage method can be used to render any Windows.UI.Xaml.UIElement. The code creates a Windows.UI.Xaml.Media.Imaging.WriteableBitmap from the element, then calls the DrawImage method:
    void DrawImage(UIElement e, Rect rc, Rect rcClip)
    {
      DrawImage(new WriteableBitmap(e, null), rc, rcClip);
    }
    See Also