StrokeCollection.Transform(Matrix, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Modifies each of the StylusPoints and optionally the StylusTipTransform for each stroke in the StrokeCollection according to the specified Matrix.
public:
void Transform(System::Windows::Media::Matrix transformMatrix, bool applyToStylusTip);
public void Transform (System.Windows.Media.Matrix transformMatrix, bool applyToStylusTip);
member this.Transform : System.Windows.Media.Matrix * bool -> unit
Public Sub Transform (transformMatrix As Matrix, applyToStylusTip As Boolean)
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
.
// 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);
}
' Move all the strokes on the InkCanvas to the right.
Private Sub MoveStrokes_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim moveMatrix As New Matrix(1, 0, 0, 1, 20, 0)
inkCanvas1.Strokes.Transform(moveMatrix, False)
End Sub
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
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應