Click or drag to resize
CanvasDrawingSessionTransform Property
Sets the transform matrix that will be applied to subsequent drawing calls on this drawing session.

Namespace:  Microsoft.Graphics.Canvas
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version:
public Matrix3x2 Transform { get; set; }

Property Value

Type: Matrix3x2

Transform may be changed multiple times in a single drawing session.

The example below demonstrates what happens when Transform is assigned different values within a single drawing session.

using (var ds = renderTarget.CreateDrawingSession())
    ds.Transform = Matrix3x2.CreateTranslation(new Vector2(10, 10));
    ds.DrawText("A", 0, 0, Colors.White); // "A" drawn at (10, 10)

    ds.Transform = Matrix3x2.CreateTranslation(new Vector2(100, 100));
    ds.DrawText("B", 0, 0, Colors.White); // "B" drawn at (100, 100)
See Also