Draws a FrameworkElement into the document at a specified position.
Namespace:
C1.Silverlight.PdfAssembly: C1.Silverlight.Pdf (in C1.Silverlight.Pdf.dll)
Syntax
C# |
---|
public void DrawElement( FrameworkElement e, Rect rc ) |
Visual Basic |
---|
Public Sub DrawElement ( _ e As FrameworkElement, _ rc As Rect _ ) |
Parameters
- e
- Type: System.Windows..::..FrameworkElement
FrameworkElement to render into the document.
- rc
- Type: System.Windows..::..Rect
Rect where the element will be rendered.
Remarks
This method uses a VisualTreeHelper to render each of the primitives that compose the root element. It does not convert the element into a bitmap. As a result, the output is smaller and resolution independent; however, the result is not as faithful as a bitmap rendering. To render an element as a bitmaps, create a WriteableBitmap and pass it to the DrawImage(WriteableBitmap, Rect) method.
This method must be called from the main thread. Calling it from a background thread will raise a cross-thread exception when the method tries to access the properties of the FrameworkElement being rendered.