TextureBrush.ResetTransform メソッド
対象の TextureBrush オブジェクトの Transform プロパティを単位行列にリセットします。
Public Sub ResetTransform()
[C#]
public void ResetTransform();
[C++]
public: void ResetTransform();
[JScript]
public function ResetTransform();
戻り値
このメソッドは値を返しません。
使用例
[Visual Basic, C#] 次の例は、Windows フォームでの使用を意図してデザインされており、 Paint イベント ハンドラのパラメータである PaintEventArgs e が必要です。このコードは次のアクションを実行します。
- TextureBrush オブジェクトを作成します。
- テクスチャ イメージを 90 度回転します。
- 四角形を塗りつぶします。
- 変換行列を単位行列にリセットします。
- 2 番目の四角形を塗りつぶします。
Public Sub ResetTransform_Example(e As PaintEventArgs)
' Create a TextureBrush object.
Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))
' Rotate the texture image by 90 degrees.
tBrush.RotateTransform(90)
' Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
' Reset transformation matrix to identity.
tBrush.ResetTransform()
' Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 110, 100, 100)
End Sub 'ResetTransform_Example.
[C#]
public void ResetTransform_Example(PaintEventArgs e)
{
// Create a TextureBrush object.
TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
// Rotate the texture image by 90 degrees.
tBrush.RotateTransform(90);
// Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
// Reset transformation matrix to identity.
tBrush.ResetTransform();
// Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 110, 100, 100);
}
[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ