Stroke.Transform(Matrix, Boolean) メソッド

定義

指定した Matrix オブジェクトに基づいて変換を実行します。

public:
 virtual void Transform(System::Windows::Media::Matrix transformMatrix, bool applyToStylusTip);
public virtual void Transform (System.Windows.Media.Matrix transformMatrix, bool applyToStylusTip);
abstract member Transform : System.Windows.Media.Matrix * bool -> unit
override this.Transform : System.Windows.Media.Matrix * bool -> unit
Public Overridable Sub Transform (transformMatrix As Matrix, applyToStylusTip As Boolean)

パラメーター

transformMatrix
Matrix

変換を定義する Matrix オブジェクト。

applyToStylusTip
Boolean

スタイラスの先端に変換を適用する場合は true。それ以外の場合は false

次の例では、オブジェクトを変換する方法を Stroke 示します。

protected DrawingVisual DrawDCOnly(Stroke myStroke)
{
    // Create new Visual context to draw on
    DrawingVisual myVisual = new DrawingVisual();
    DrawingContext myContext = myVisual.RenderOpen();

    // myMatrix is scaled by:
    // myMatrix.Scale(0.5, 0.5)
    myStroke.Transform(myMatrix, false);

    // Draw the stroke on the Visual context using DrawingContext
    myStroke.Draw(myContext);

    // Close the context
    myContext.Close();

    return myVisual;
}
Function DrawDCOnly(ByVal myStroke As Stroke) As DrawingVisual

    ' Create new Visual context to draw on
    Dim myVisual As DrawingVisual = New DrawingVisual()
    Dim myContext As DrawingContext = myVisual.RenderOpen()

    ' myMatrix is scaled by:
    ' myMatrix.Scale(0.5, 0.5)
    myStroke.Transform(myMatrix, False)

    ' Draw the stroke on the Visual context using DrawingContext
    myStroke.Draw(myContext)

    ' Close the context
    myContext.Close()

    Return myVisual

End Function

注釈

このオブジェクトは Matrix 、2 次元空間での変換に使用される 3 x 3 マトリックスを表します。 Stroke オブジェクトの各ポイントは、指定された Matrix によって変換されます。 たとえば、元の Point.X 値が 100 の場合、元の Point.Y 値は 55、変換 Matrix.Scale(0.5, 0.5) の場合、新しい Point.X 値は 50、新しい Point.Y 値は 27.5 です。

適用対象