ComponentOne Word for UWP
DrawElement(FrameworkElement,Rect,Rect) Method

C1.UWP.Word Assembly > C1.Xaml.Word Namespace > C1WordDocument Class > DrawElement Method : DrawElement(FrameworkElement,Rect,Rect) Method
Windows.UI.Xaml.FrameworkElement to render into the document.
A rectangle where the element will be rendered.
A rectangle that defines the clipping bounds.
Draws a Windows.UI.Xaml.FrameworkElement into the document at a specified position.
Syntax
'Declaration
 
Public Overloads Function DrawElement( _
   ByVal e As Windows.UI.Xaml.FrameworkElement, _
   ByVal rc As Windows.Foundation.Rect, _
   ByVal rcClip As Windows.Foundation.Rect _
) As System.Threading.Tasks.Task
public System.Threading.Tasks.Task DrawElement( 
   Windows.UI.Xaml.FrameworkElement e,
   Windows.Foundation.Rect rc,
   Windows.Foundation.Rect rcClip
)

Parameters

e
Windows.UI.Xaml.FrameworkElement to render into the document.
rc
A rectangle where the element will be rendered.
rcClip
A rectangle that defines the clipping bounds.
Remarks

This method uses a Windows.UI.Xaml.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 Windows.UI.Xaml.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 Windows.UI.Xaml.FrameworkElement being rendered.

See Also

Reference

C1WordDocument Class
C1WordDocument Members
Overload List