PDF for WinRT
DrawImage(WriteableBitmap,Rect,ContentAlignment,Stretch) Method
Example 


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.
ContentAlignment value that specifies how the image should be aligned within the rectangle.
Windows.UI.Xaml.Media.Stretch value that specifies how the image should be sized to fit the rectangle.
Draws the specified Windows.UI.Xaml.Media.Imaging.WriteableBitmap object at the specified location, adjusting the image size as specified by the align and stretch parameters.
Syntax
'Declaration
 
Public Overloads Sub DrawImage( _
   ByVal img As WriteableBitmap, _
   ByVal rc As Rect, _
   ByVal align As ContentAlignment, _
   ByVal stretch As Stretch _
) 
'Usage
 
Dim instance As C1PdfDocument
Dim img As WriteableBitmap
Dim rc As Rect
Dim align As ContentAlignment
Dim stretch As Stretch
 
instance.DrawImage(img, rc, align, stretch)

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.
align
ContentAlignment value that specifies how the image should be aligned within the rectangle.
stretch
Windows.UI.Xaml.Media.Stretch value that specifies how the image should be sized to fit the 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, ContentAlignment align, ImageSizeMode mode)
{
  DrawImage(new WriteableBitmap(e, null), rc, align, mode);
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

C1PdfDocument Class
C1PdfDocument Members
Overload List

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback