GraphicsPath.Warp Methode

Definition

Weist diesem GraphicsPath eine durch ein Rechteck und ein Parallelogramm definierte Verzerrungstransformation zu.

Überlädt

Warp(PointF[], RectangleF)

Weist diesem GraphicsPath eine durch ein Rechteck und ein Parallelogramm definierte Verzerrungstransformation zu.

Warp(PointF[], RectangleF, Matrix)

Weist diesem GraphicsPath eine durch ein Rechteck und ein Parallelogramm definierte Verzerrungstransformation zu.

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

Weist diesem GraphicsPath eine durch ein Rechteck und ein Parallelogramm definierte Verzerrungstransformation zu.

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

Weist diesem GraphicsPath eine durch ein Rechteck und ein Parallelogramm definierte Verzerrungstransformation zu.

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

Warp(PointF[], RectangleF)

Quelle:
GraphicsPath.cs
Quelle:
GraphicsPath.cs
Quelle:
GraphicsPath.cs

Weist diesem GraphicsPath eine durch ein Rechteck und ein Parallelogramm definierte Verzerrungstransformation zu.

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)

Parameter

destPoints
PointF[]

Ein Array von PointF-Strukturen, die ein Parallelogramm definieren, in das das durch srcRect definierte Rechteck transformiert wird. Das Array kann entweder drei oder vier Elemente enthalten. Wenn das Array drei Elemente enthält, ergibt sich die untere rechte Ecke des Parallelogramms aus den ersten drei Punkten.

srcRect
RectangleF

Ein RectangleF, das das Rechteck darstellt, das in das durch destPoints definierte Parallelogramm transformiert wird.

Beispiele

Ein Beispiel finden Sie unter Warp(PointF[], RectangleF, Matrix, WarpMode, Single).

Gilt für:

Warp(PointF[], RectangleF, Matrix)

Quelle:
GraphicsPath.cs
Quelle:
GraphicsPath.cs
Quelle:
GraphicsPath.cs

Weist diesem GraphicsPath eine durch ein Rechteck und ein Parallelogramm definierte Verzerrungstransformation zu.

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)

Parameter

destPoints
PointF[]

Ein Array von PointF-Strukturen, die ein Parallelogramm definieren, in das das durch srcRect definierte Rechteck transformiert wird. Das Array kann entweder drei oder vier Elemente enthalten. Wenn das Array drei Elemente enthält, ergibt sich die untere rechte Ecke des Parallelogramms aus den ersten drei Punkten.

srcRect
RectangleF

Ein RectangleF, das das Rechteck darstellt, das in das durch destPoints definierte Parallelogramm transformiert wird.

matrix
Matrix

Eine Matrix, die eine dem Pfad zuzuweisende geometrische Transformation angibt.

Beispiele

Ein Beispiel finden Sie unter Warp(PointF[], RectangleF, Matrix, WarpMode, Single).

Gilt für:

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

Quelle:
GraphicsPath.cs
Quelle:
GraphicsPath.cs
Quelle:
GraphicsPath.cs

Weist diesem GraphicsPath eine durch ein Rechteck und ein Parallelogramm definierte Verzerrungstransformation zu.

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)

Parameter

destPoints
PointF[]

Ein Array von PointF-Strukturen, das ein Parallelogramm definiert, in das das durch srcRect definierte Rechteck transformiert wird. Das Array kann entweder drei oder vier Elemente enthalten. Wenn das Array drei Elemente enthält, ergibt sich die untere rechte Ecke des Parallelogramms aus den ersten drei Punkten.

srcRect
RectangleF

Ein RectangleF, das das Rechteck darstellt, das in das durch destPoints definierte Parallelogramm transformiert wird.

matrix
Matrix

Eine Matrix, die eine dem Pfad zuzuweisende geometrische Transformation angibt.

warpMode
WarpMode

Eine WarpMode-Enumeration, die angibt, ob bei dieser Verzerrung der perspektivische oder der bilineare Modus verwendet wird.

Beispiele

Ein Beispiel finden Sie unter Warp(PointF[], RectangleF, Matrix, WarpMode, Single).

Gilt für:

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

Quelle:
GraphicsPath.cs
Quelle:
GraphicsPath.cs
Quelle:
GraphicsPath.cs

Weist diesem GraphicsPath eine durch ein Rechteck und ein Parallelogramm definierte Verzerrungstransformation zu.

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)

Parameter

destPoints
PointF[]

Ein Array von PointF-Strukturen, die ein Parallelogramm definieren, in das das durch srcRect definierte Rechteck transformiert wird. Das Array kann entweder drei oder vier Elemente enthalten. Wenn das Array drei Elemente enthält, ergibt sich die untere rechte Ecke des Parallelogramms aus den ersten drei Punkten.

srcRect
RectangleF

Ein RectangleF, das das Rechteck darstellt, das in das durch destPoints definierte Parallelogramm transformiert wird.

matrix
Matrix

Eine Matrix, die eine dem Pfad zuzuweisende geometrische Transformation angibt.

warpMode
WarpMode

Eine WarpMode-Enumeration, die angibt, ob bei dieser Verzerrung der perspektivische oder der bilineare Modus verwendet wird.

flatness
Single

Ein Wert von 0 bis 1, der angibt, wie flach der resultierende Pfad ist. Weitere Informationen finden Sie unter Flatten()-Methoden.

Beispiele

Das folgende Codebeispiel ist für die Verwendung mit Windows Forms konzipiert und erfordert PaintEventArgse, ein OnPaint Ereignisobjekt. Der Code führt die folgenden Aktionen aus:

  • Erstellt einen Pfad und fügt dem Pfad ein Rechteck hinzu.

  • Zeichnet dieses Rechteck in Schwarz auf den Bildschirm.

  • Verwarnt den Pfad mit einer perspektivisch verzogenen Verzerrung.

  • Zeichnet das verzogene Rechteck (Pfad) rot auf den Bildschirm.

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

Gilt für:

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

Quelle:
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)

Parameter

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

Gilt für: