[]
Draws the specified WriteableBitmap object at the specified location,
adjusting the image size as specified by the align
and
stretch
parameters.
public void DrawElement(FrameworkElement e, Rect rc, ContentAlignment align, Stretch stretch)
Type | Name | Description |
---|---|---|
FrameworkElement | e | FrameworkElement to render into the document. |
Rect | rc | The rectangle structure that specifies the location of the drawn element, in points from the top left corner of the page. |
ContentAlignment | align | ContentAlignment value that specifies how the element should be aligned within the rectangle. |
Stretch | stretch | Stretch value that specifies how the element should be sized to fit the rectangle. |
<p>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.
Draws a FrameworkElement into the document at a specified position.
public void DrawElement(FrameworkElement e, Rect rc, Rect rcClip)
Type | Name | Description |
---|---|---|
FrameworkElement | e | FrameworkElement to render into the document. |
Rect | rc | A rectangle where the element will be rendered. |
Rect | rcClip | A rectangle that defines the clipping bounds. |
<p>This method uses a <xref href="System.Windows.Media.VisualTreeHelper" data-throw-if-not-resolved="false"></xref> 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.
Draws a FrameworkElement into the document at a specified position.
public void DrawElement(FrameworkElement e, Rect rc)
Type | Name | Description |
---|---|---|
FrameworkElement | e | FrameworkElement to render into the document. |
Rect | rc | A rectangle where the element will be rendered. |
<p>This method uses a <xref href="System.Windows.Media.VisualTreeHelper" data-throw-if-not-resolved="false"></xref> 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.