ComponentOne PDF for WPF and Silverlight
DrawElement(FrameworkElement,Rect,Rect) Method

C1.WPF.Pdf.4 Assembly > C1.WPF.Pdf Namespace > C1PdfDocument Class > DrawElement Method : DrawElement(FrameworkElement,Rect,Rect) Method
System.Windows.FrameworkElement to render into the document.
System.Windows.Rect where the element will be rendered.
System.Windows.Rect that defines the clipping bounds.
Draws a System.Windows.FrameworkElement into the document at a specified position.
Syntax
'Declaration
 
Public Overloads Sub DrawElement( _
   ByVal e As FrameworkElement, _
   ByVal rc As Rect, _
   ByVal rcClip As Rect _
) 
public void DrawElement( 
   FrameworkElement e,
   Rect rc,
   Rect rcClip
)

Parameters

e
System.Windows.FrameworkElement to render into the document.
rc
System.Windows.Rect where the element will be rendered.
rcClip
System.Windows.Rect that defines the clipping bounds.
Remarks

This method uses a System.Windows.Media.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 System.Windows.Media.Imaging.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 System.Windows.FrameworkElement being rendered.

See Also

Reference

C1PdfDocument Class
C1PdfDocument Members
Overload List