[]
Draws the specified WriteableBitmap object at the specified location,
adjusting the image size as specified by the align and
stretch parameters.
public void DrawImage(WriteableBitmap img, Rect rc, ContentAlignment align, Stretch stretch)
Public Sub DrawImage(img As WriteableBitmap, rc As Rect, align As ContentAlignment, stretch As Stretch)
| Type | Name | Description |
|---|---|---|
| WriteableBitmap | img | WriteableBitmap object to draw. |
| Rect | rc | System.Windows.Rect structure that specifies the location of the drawn image, in points from the top left corner of the page. |
| ContentAlignment | align | C1.Util.ContentAlignment value that specifies how the image should be aligned within the rectangle. |
| Stretch | stretch | Stretch value that specifies how the image should be sized to fit the rectangle. |
The code below shows how you can use the DrawImage method can be used to render any UIElement. The code creates a 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);
}
Draws the specified WriteableBitmap object at the specified location, stretching it to fit the destination rectangle.
public void DrawImage(WriteableBitmap img, Rect rc)
Public Sub DrawImage(img As WriteableBitmap, rc As Rect)
| Type | Name | Description |
|---|---|---|
| WriteableBitmap | img | WriteableBitmap object to draw. |
| Rect | rc | System.Windows.Rect structure that specifies the location of the drawn image, in points from the top left corner of the page. |
The code below shows how you can use the DrawImage method can be used to render any UIElement. The code creates a WriteableBitmap from the element, then calls the DrawImage method:
void DrawImage(UIElement e, Rect rc)
{
DrawImage(new WriteableBitmap(e, null), rc);
}
Draws the specified WriteableBitmap object at the specified location, clipping the output to the given clipping rectangle.
public void DrawImage(WriteableBitmap img, Rect rc, Rect rcClip)
Public Sub DrawImage(img As WriteableBitmap, rc As Rect, rcClip As Rect)
| Type | Name | Description |
|---|---|---|
| WriteableBitmap | img | WriteableBitmap object to draw. |
| Rect | rc | System.Windows.Rect structure that specifies the location of the drawn image, in points from the top left corner of the page. |
| Rect | rcClip | System.Windows.Rect structure that specifies a clipping rectangle on the page. No part of the image is drawn outside the clipping rectangle. |
The code below shows how you can use the DrawImage method can be used to render any UIElement. The code creates a WriteableBitmap from the element, then calls the DrawImage method:
void DrawImage(UIElement e, Rect rc, Rect rcClip)
{
DrawImage(new WriteableBitmap(e, null), rc, rcClip);
}
Draws the specified ARGB pixels at the specified location, clipping the output to the given clipping rectangle.
public void DrawImage(int width, int height, int[] pixels, Rect rc, Rect rcClip)
Public Sub DrawImage(width As Integer, height As Integer, pixels As Integer(), rc As Rect, rcClip As Rect)
| Type | Name | Description |
|---|---|---|
| int | width | The width of thne image in pixels. |
| int | height | The height of thne image in pixels. |
| int[] | pixels | The ARGB color array. |
| Rect | rc | System.Windows.Rect structure that specifies the location of the drawn image, in points from the top left corner of the page. |
| Rect | rcClip | System.Windows.Rect structure that specifies a clipping rectangle on the page. No part of the image is drawn outside the clipping rectangle. |