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: 0.0.0.0
Syntax
C#
public static CanvasDrawingSession CreateDrawingSession(
	CompositionDrawingSurface drawingSurface,
	Rect updateRectInPixels,
	float dpi
)

Parameters

drawingSurface
Type: Windows.UI.CompositionCompositionDrawingSurface
updateRectInPixels
Type: Windows.FoundationRect
dpi
Type: SystemSingle

Return Value

Type: CanvasDrawingSession
Remarks

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