LinearGradientBrush.ResetTransform メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > LinearGradientBrush.ResetTransform メソッドの意味・解説 

LinearGradientBrush.ResetTransform メソッド

Transform プロパティ単位行列リセットします。

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub ResetTransform
Dim instance As LinearGradientBrush

instance.ResetTransform
public void ResetTransform ()
public:
void ResetTransform ()
public void ResetTransform ()
public function ResetTransform ()
使用例使用例

次のコード例は、Windows フォームでの使用意図してデザインされており、OnPaint イベント オブジェクトである PaintEventArgse が必要です。このコード次のアクション実行します

1 番下の楕円最初楕円と同じサイズ描画されるため、ResetTransform メソッド呼び出すことで、それに合わせてグラデーション縮小されます。

Public Sub ResetTransformExample(ByVal
 e As PaintEventArgs)

    ' Create a LinearGradientBrush.
    Dim myRect As New Rectangle(20,
 20, 200, 100)
    Dim myLGBrush As New
 LinearGradientBrush(myRect, Color.Blue, _
    Color.Red, 0.0F, True)

    ' Draw an ellipse to the screen using the LinearGradientBrush.
    e.Graphics.FillEllipse(myLGBrush, myRect)

    ' Transform the LinearGradientBrush.
    Dim transformArray As Point() = {New Point(20,
 150), _
    New Point(400, 150), New Point(20, 200)}
    Dim myMatrix As New
 Matrix(myRect, transformArray)
    myLGBrush.MultiplyTransform(myMatrix, MatrixOrder.Prepend)

    ' Draw a second ellipse to the screen using the transformed brush.
    e.Graphics.FillEllipse(myLGBrush, 20, 150, 380, 50)

    ' Reset the brush transform.
    myLGBrush.ResetTransform()

    ' Draw a third ellipse to the screen using the reset brush.
    e.Graphics.FillEllipse(myLGBrush, 20, 250, 200, 100)
End Sub
private void ResetTransformExample(PaintEventArgs
 e)
{
             
    // Create a LinearGradientBrush.
    Rectangle myRect = new Rectangle(20, 20, 200, 100);
    LinearGradientBrush myLGBrush = new LinearGradientBrush(
        myRect, Color.Blue, Color.Red,  0.0f, true);
             
    // Draw an ellipse to the screen using the LinearGradientBrush.
    e.Graphics.FillEllipse(myLGBrush, myRect);
             
    // Transform the LinearGradientBrush.
    Point[] transformArray = { new Point(20, 150),
         new Point(400,150), new Point(20,
 200) };
       
    Matrix myMatrix = new Matrix(myRect, transformArray);
    myLGBrush.MultiplyTransform( myMatrix, MatrixOrder.Prepend);
             
    // Draw a second ellipse to the screen
    // using the transformed brush.
    e.Graphics.FillEllipse(myLGBrush, 20, 150, 380, 50);
             
    // Reset the brush transform.
    myLGBrush.ResetTransform();
             
    // Draw a third ellipse to the screen using the reset brush.
    e.Graphics.FillEllipse(myLGBrush, 20, 250, 200, 100);
}
private:
   void ResetTransformExample( PaintEventArgs^ e )
   {
      // Create a LinearGradientBrush.
      Rectangle myRect = Rectangle(20,20,200,100);
      LinearGradientBrush^ myLGBrush = gcnew LinearGradientBrush( myRect,Color::Blue,Color::Red,0.0f,true
 );

      // Draw an ellipse to the screen using the LinearGradientBrush.
      e->Graphics->FillEllipse( myLGBrush, myRect );

      // Transform the LinearGradientBrush.
      array<Point>^ transformArray = {Point(20,150),Point(400,150),Point(20
,200)};
      Matrix^ myMatrix = gcnew Matrix( myRect,transformArray );
      myLGBrush->MultiplyTransform( myMatrix, MatrixOrder::Prepend );

      // Draw a second ellipse to the screen
      // using the transformed brush.
      e->Graphics->FillEllipse( myLGBrush, 20, 150, 380, 50 );

      // Reset the brush transform.
      myLGBrush->ResetTransform();

      // Draw a third ellipse to the screen using the reset brush.
      e->Graphics->FillEllipse( myLGBrush, 20, 250, 200, 100 );
   }
private void ResetTransformExample(PaintEventArgs
 e)
{
    // Create a LinearGradientBrush.
    Rectangle myRect = new Rectangle(20, 20, 200, 100);
    LinearGradientBrush myLGBrush = new LinearGradientBrush(myRect,
 
        Color.get_Blue(), Color.get_Red(), 0, true);

    // Draw an ellipse to the screen using the LinearGradientBrush.
    e.get_Graphics().FillEllipse(myLGBrush, myRect);

    // Transform the LinearGradientBrush.
    Point transformArray[] = { new Point(20, 150), new
 Point(400, 150), 
                            new Point(20, 200) };
    Matrix myMatrix = new Matrix(myRect, transformArray);

    myLGBrush.MultiplyTransform(myMatrix, MatrixOrder.Prepend);

    // Draw a second ellipse to the screen
    // using the transformed brush.
    e.get_Graphics().FillEllipse(myLGBrush, 20, 150, 380, 50);

    // Reset the brush transform.
    myLGBrush.ResetTransform();

    // Draw a third ellipse to the screen using the reset brush.
    e.get_Graphics().FillEllipse(myLGBrush, 20, 250, 200, 100);
} //ResetTransformExample
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
LinearGradientBrush クラス
LinearGradientBrush メンバ
System.Drawing.Drawing2D 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

LinearGradientBrush.ResetTransform メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



LinearGradientBrush.ResetTransform メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS