Click or drag to resize
CanvasVirtualImageSourceCreateDrawingSession Method
Returns a new drawing session for updating a region of the image source.

Namespace:  Microsoft.Graphics.Canvas.UI.Xaml
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public CanvasDrawingSession CreateDrawingSession(
	Color clearColor,
	Rect updateRectangle
)

Parameters

clearColor
Type: Windows.UIColor
updateRectangle
Type: Windows.FoundationRect

Return Value

Type: CanvasDrawingSession
Remarks

The specified region of the image is cleared to the specified color before this method returns. The region is in device independent pixels (DIPs). Regions that need to be updated are provided by the InvalidatedRegions property passed to the RegionsInvalidated event handler.

CreateDrawingSession may be called on any thread, but the returned drawing session must be disposed on the UI thread. If you want to move your drawing work to a different thread, either:

  1. On an arbitrary non-UI thread:
  2. Back on the UI thread:
    • drawingSession.Dispose()

or:

  1. On the UI thread:
  2. Move to an arbitrary non-UI thread:
  3. Back on the UI thread:
    • drawingSession.Dispose()
See Also