StrokeCollection.Transform(Matrix, Boolean) Method

Definition

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

C#
public void Transform(System.Windows.Media.Matrix transformMatrix, bool applyToStylusTip);

Parameters

transformMatrix
Matrix

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

applyToStylusTip
Boolean

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

Examples

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

C#
// 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);
}

Remarks

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.

Applies to

Produkt Verzie
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10