Freigeben über


WriteableBitmap.Render Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Renders an element within the bitmap.

Namespace:  System.Windows.Media.Imaging
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Sub Render ( _
    element As UIElement, _
    transform As Transform _
)
public void Render(
    UIElement element,
    Transform transform
)

Parameters

  • transform
    Type: System.Windows.Media.Transform
    The transform to apply to the element before drawing into the bitmap. If an empty transform is supplied, the bits representing the element show up at the same offset as if they were placed within their parent.

Exceptions

Exception Condition
ArgumentNullException

element is null.

Remarks

After calling this method, you must call Invalidate in order to render the bitmap.

This method does support UIElement objects that are not part of the visual tree. You are required to call Measure and Arrange for UIElement objects that are not in the visual tree, before calling Render.

If the element is larger than the size of the bitmap, or if the element has any points in the negative regions of its own space, it is clipped as appropriate.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.