Stroke.Transform(Matrix, Boolean) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した 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)
パラメーター
- 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 次元空間での変換に使用される 3x3 行列を表します。 Stroke オブジェクトの各ポイントは、指定された Matrix によって変換されます。 たとえば、元の Point.X 値が 100、元の Point.Y 値が 55、変換 Matrix.Scale(0.5, 0.5) の場合、新しい Point.X 値は 50、新しい Point.Y 値は 27.5 です。