GraphicsPath.Warp メソッド

定義

GraphicsPath に、四角形と平行四辺形によって定義されたワープ変換を適用します。

オーバーロード

Warp(PointF[], RectangleF)

GraphicsPath に、四角形と平行四辺形によって定義されたワープ変換を適用します。

Warp(PointF[], RectangleF, Matrix)

GraphicsPath に、四角形と平行四辺形によって定義されたワープ変換を適用します。

Warp(PointF[], RectangleF, Matrix, WarpMode)

GraphicsPath に、四角形と平行四辺形によって定義されたワープ変換を適用します。

Warp(PointF[], RectangleF, Matrix, WarpMode, Single)

GraphicsPath に、四角形と平行四辺形によって定義されたワープ変換を適用します。

Warp(ReadOnlySpan<PointF>, RectangleF, Matrix, WarpMode, Single)

Warp(PointF[], RectangleF)

ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs

GraphicsPath に、四角形と平行四辺形によって定義されたワープ変換を適用します。

public:
 void Warp(cli::array <System::Drawing::PointF> ^ destPoints, System::Drawing::RectangleF srcRect);
public void Warp (System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect);
member this.Warp : System.Drawing.PointF[] * System.Drawing.RectangleF -> unit
Public Sub Warp (destPoints As PointF(), srcRect As RectangleF)

パラメーター

destPoints
PointF[]

srcRect によって定義された四角形を変形した結果の平行四辺形を定義する PointF 構造体の配列。 配列には、3 つまたは 4 つの要素を含めることができます。 配列に 3 つの要素が含まれている場合、平行四辺形の右下の頂点は最初の 3 つの点から類推されます。

srcRect
RectangleF

destPoints によって定義された平行四辺形に変形される四角形を表す RectangleF

例については、「Warp(PointF[], RectangleF, Matrix, WarpMode, Single)」を参照してください。

適用対象

Warp(PointF[], RectangleF, Matrix)

ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs

GraphicsPath に、四角形と平行四辺形によって定義されたワープ変換を適用します。

public:
 void Warp(cli::array <System::Drawing::PointF> ^ destPoints, System::Drawing::RectangleF srcRect, System::Drawing::Drawing2D::Matrix ^ matrix);
public void Warp (System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix matrix);
public void Warp (System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix? matrix);
member this.Warp : System.Drawing.PointF[] * System.Drawing.RectangleF * System.Drawing.Drawing2D.Matrix -> unit
Public Sub Warp (destPoints As PointF(), srcRect As RectangleF, matrix As Matrix)

パラメーター

destPoints
PointF[]

srcRect によって定義された四角形を変形した結果の平行四辺形を定義する PointF 構造体の配列。 配列には、3 つまたは 4 つの要素を含めることができます。 配列に 3 つの要素が含まれている場合、平行四辺形の右下の頂点は最初の 3 つの点から類推されます。

srcRect
RectangleF

destPoints によって定義された平行四辺形に変形される四角形を表す RectangleF

matrix
Matrix

パスに適用するジオメトリック変換を指定する Matrix

例については、「Warp(PointF[], RectangleF, Matrix, WarpMode, Single)」を参照してください。

適用対象

Warp(PointF[], RectangleF, Matrix, WarpMode)

ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs

GraphicsPath に、四角形と平行四辺形によって定義されたワープ変換を適用します。

public:
 void Warp(cli::array <System::Drawing::PointF> ^ destPoints, System::Drawing::RectangleF srcRect, System::Drawing::Drawing2D::Matrix ^ matrix, System::Drawing::Drawing2D::WarpMode warpMode);
public void Warp (System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.WarpMode warpMode);
public void Warp (System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix? matrix, System.Drawing.Drawing2D.WarpMode warpMode);
member this.Warp : System.Drawing.PointF[] * System.Drawing.RectangleF * System.Drawing.Drawing2D.Matrix * System.Drawing.Drawing2D.WarpMode -> unit
Public Sub Warp (destPoints As PointF(), srcRect As RectangleF, matrix As Matrix, warpMode As WarpMode)

パラメーター

destPoints
PointF[]

srcRect によって定義された四角形を変形した結果、作成される平行四辺形を定義する PointF 構造体の配列。 配列には、3 つまたは 4 つの要素を含めることができます。 配列に 3 つの要素が含まれている場合、平行四辺形の右下の頂点は最初の 3 つの点から類推されます。

srcRect
RectangleF

destPoints によって定義された平行四辺形に変形される四角形を表す RectangleF

matrix
Matrix

パスに適用するジオメトリック変換を指定する Matrix

warpMode
WarpMode

この変形操作で遠近モードまたは双一次モードを使用するかどうかを指定する WarpMode 列挙体。

例については、「Warp(PointF[], RectangleF, Matrix, WarpMode, Single)」を参照してください。

適用対象

Warp(PointF[], RectangleF, Matrix, WarpMode, Single)

ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs
ソース:
GraphicsPath.cs

GraphicsPath に、四角形と平行四辺形によって定義されたワープ変換を適用します。

public:
 void Warp(cli::array <System::Drawing::PointF> ^ destPoints, System::Drawing::RectangleF srcRect, System::Drawing::Drawing2D::Matrix ^ matrix, System::Drawing::Drawing2D::WarpMode warpMode, float flatness);
public void Warp (System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.WarpMode warpMode, float flatness);
public void Warp (System.Drawing.PointF[] destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix? matrix, System.Drawing.Drawing2D.WarpMode warpMode, float flatness);
member this.Warp : System.Drawing.PointF[] * System.Drawing.RectangleF * System.Drawing.Drawing2D.Matrix * System.Drawing.Drawing2D.WarpMode * single -> unit
Public Sub Warp (destPoints As PointF(), srcRect As RectangleF, matrix As Matrix, warpMode As WarpMode, flatness As Single)

パラメーター

destPoints
PointF[]

srcRect によって定義された四角形を変形した結果の平行四辺形を定義する PointF 構造体の配列。 配列には、3 つまたは 4 つの要素を含めることができます。 配列に 3 つの要素が含まれている場合、平行四辺形の右下の頂点は最初の 3 つの点から類推されます。

srcRect
RectangleF

destPoints によって定義された平行四辺形に変形される四角形を表す RectangleF

matrix
Matrix

パスに適用するジオメトリック変換を指定する Matrix

warpMode
WarpMode

この変形操作で遠近モードまたは双一次モードを使用するかどうかを指定する WarpMode 列挙体。

flatness
Single

結果として生成されたパスの平坦度を指定する 0 から 1 の値。 詳細については、Flatten() メソッドのトピックを参照してください。

次のコード例は、Windows フォームで使用するように設計されており、イベント オブジェクトがOnPaint必要PaintEventArgseです。 コードは、次のアクションを実行します。

  • パスを作成し、パスに四角形を追加します。

  • その四角形を黒で画面に描画します。

  • パース ワープを使用してパスをワープします。

  • ゆがんだ四角形 (パス) を赤で画面に描画します。

private:
   void WarpExample( PaintEventArgs^ e )
   {
      // Create a path and add a rectangle.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      RectangleF srcRect = RectangleF(0,0,100,200);
      myPath->AddRectangle( srcRect );

      // Draw the source path (rectangle)to the screen.
      e->Graphics->DrawPath( Pens::Black, myPath );

      // Create a destination for the warped rectangle.
      PointF point1 = PointF(200,200);
      PointF point2 = PointF(400,250);
      PointF point3 = PointF(220,400);
      array<PointF>^ destPoints = {point1,point2,point3};

      // Create a translation matrix.
      Matrix^ translateMatrix = gcnew Matrix;
      translateMatrix->Translate( 100, 0 );

      // Warp the source path (rectangle).
      myPath->Warp( destPoints, srcRect, translateMatrix, WarpMode::Perspective, 0.5f );

      // Draw the warped path (rectangle) to the screen.
      e->Graphics->DrawPath( gcnew Pen( Color::Red ), myPath );
   }
private void WarpExample(PaintEventArgs e)
{
             
    // Create a path and add a rectangle.
    GraphicsPath myPath = new GraphicsPath();
    RectangleF srcRect = new RectangleF(0, 0, 100, 200);
    myPath.AddRectangle(srcRect);
             
    // Draw the source path (rectangle)to the screen.
    e.Graphics.DrawPath(Pens.Black, myPath);
             
    // Create a destination for the warped rectangle.
    PointF point1 = new PointF(200, 200);
    PointF point2 = new PointF(400, 250);
    PointF point3 = new PointF(220, 400);
    PointF[] destPoints = {point1, point2, point3};
             
    // Create a translation matrix.
    Matrix translateMatrix = new Matrix();
    translateMatrix.Translate(100, 0);
             
    // Warp the source path (rectangle).
    myPath.Warp(destPoints, srcRect, translateMatrix,
        WarpMode.Perspective, 0.5f);
             
    // Draw the warped path (rectangle) to the screen.
    e.Graphics.DrawPath(new Pen(Color.Red), myPath);
}
Public Sub WarpExample(ByVal e As PaintEventArgs)

    ' Create a path and add a rectangle.
    Dim myPath As New GraphicsPath
    Dim srcRect As New RectangleF(0, 0, 100, 200)
    myPath.AddRectangle(srcRect)

    ' Draw the source path (rectangle)to the screen.
    e.Graphics.DrawPath(Pens.Black, myPath)

    ' Create a destination for the warped rectangle.
    Dim point1 As New PointF(200, 200)
    Dim point2 As New PointF(400, 250)
    Dim point3 As New PointF(220, 400)
    Dim destPoints As PointF() = {point1, point2, point3}

    ' Create a translation matrix.
    Dim translateMatrix As New Matrix
    translateMatrix.Translate(100, 0)

    ' Warp the source path (rectangle).
    myPath.Warp(destPoints, srcRect, translateMatrix, _
    WarpMode.Perspective, 0.5F)

    ' Draw the warped path (rectangle) to the screen.
    e.Graphics.DrawPath(New Pen(Color.Red), myPath)
End Sub

適用対象

Warp(ReadOnlySpan<PointF>, RectangleF, Matrix, WarpMode, Single)

ソース:
GraphicsPath.cs
public void Warp (ReadOnlySpan<System.Drawing.PointF> destPoints, System.Drawing.RectangleF srcRect, System.Drawing.Drawing2D.Matrix? matrix = default, System.Drawing.Drawing2D.WarpMode warpMode = System.Drawing.Drawing2D.WarpMode.Perspective, float flatness = 0.25);
member this.Warp : ReadOnlySpan<System.Drawing.PointF> * System.Drawing.RectangleF * System.Drawing.Drawing2D.Matrix * System.Drawing.Drawing2D.WarpMode * single -> unit
Public Sub Warp (destPoints As ReadOnlySpan(Of PointF), srcRect As RectangleF, Optional matrix As Matrix = Nothing, Optional warpMode As WarpMode = System.Drawing.Drawing2D.WarpMode.Perspective, Optional flatness As Single = 0.25)

パラメーター

destPoints
ReadOnlySpan<PointF>
srcRect
RectangleF
matrix
Matrix
warpMode
WarpMode
flatness
Single

適用対象