Export (0) Print
Expand All

StrokeCollection.Transform Method

Modifies each of the StylusPoints and optionally the StylusTipTransform for each stroke in the StrokeCollection according to the specified Matrix.

Namespace:  System.Windows.Ink
Assembly:  PresentationCore (in PresentationCore.dll)

public void Transform(
	Matrix transformMatrix,
	bool applyToStylusTip
)

Parameters

transformMatrix
Type: System.Windows.Media.Matrix

A Matrix which specifies the transformation to perform on the StrokeCollection.

applyToStylusTip
Type: System.Boolean

true to apply the transformation to the tip of the stylus; otherwise, false.

When applyToStylusTip is true, the Transform method affects the shape of the stylus tip, as well as the position of the strokes. For example, if you rotate a StrokeCollection 90 degrees, the strokes move around an axis and the height and width of the strokes appear to be inverted.

The following example demonstrates how to move all the strokes on an InkCanvas. This example assumes that there is an InkCanvas called inkCanvas1.

// Move all the strokes on the InkCanvas to the right. 
private void MoveStrokes_Click(object sender, RoutedEventArgs e)
{
    Matrix moveMatrix = new Matrix(1, 0, 0, 1, 20, 0);

    inkCanvas1.Strokes.Transform(moveMatrix, false);
}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft