Click or drag to resize
CanvasCompositionCreateDrawingSession Method (CompositionDrawingSurface, Rect, Single)
[Win10_10586] Creates a CanvasDrawingSession for updating a region of the given CompositionDrawingSurface, using a custom DPI setting.

Namespace:  Microsoft.Graphics.Canvas.UI.Composition
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version:
public static CanvasDrawingSession CreateDrawingSession(
	CompositionDrawingSurface drawingSurface,
	Rect updateRectInPixels,
	float dpi


Type: Windows.UI.CompositionCompositionDrawingSurface
Type: Windows.FoundationRect
Type: SystemSingle

Return Value

Type: CanvasDrawingSession

This API is only available when running on Windows 10 build 10586 (released November 2015) or greater.

The drawing session will use the specified DPI. If this is any value other than the default 96, DIPs and pixels will not be the same, so drawing will be scaled up or down accordingly. Note that this DPI setting only affects the scale of drawing performed by the returned drawing session. Other composition APIs, including the updateRectInPixels parameter to this method, always operate in pixel units.

For more information, see DPI and DIPs.

See Also