GraphicsPath.Warp Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Aplica una transformación de alabeo, definida por un rectángulo y un paralelogramo, a este trazado GraphicsPath.
Sobrecargas
Warp(PointF[], RectangleF) |
Aplica una transformación de alabeo, definida por un rectángulo y un paralelogramo, a este trazado GraphicsPath. |
Warp(PointF[], RectangleF, Matrix) |
Aplica una transformación de alabeo, definida por un rectángulo y un paralelogramo, a este trazado GraphicsPath. |
Warp(PointF[], RectangleF, Matrix, WarpMode) |
Aplica una transformación de alabeo, definida por un rectángulo y un paralelogramo, a este trazado GraphicsPath. |
Warp(PointF[], RectangleF, Matrix, WarpMode, Single) |
Aplica una transformación de alabeo, definida por un rectángulo y un paralelogramo, a este trazado GraphicsPath. |
Warp(ReadOnlySpan<PointF>, RectangleF, Matrix, WarpMode, Single) |
Warp(PointF[], RectangleF)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Aplica una transformación de alabeo, definida por un rectángulo y un paralelogramo, a este trazado 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)
Parámetros
- destPoints
- PointF[]
Matriz de estructuras PointF que definen un paralelogramo en que se transforma el rectángulo definido por srcRect
. La matriz puede contener tres elementos o cuatro. Si la matriz contiene tres elementos, el ángulo inferior derecho del paralelogramo viene definido por los tres primeros puntos.
- srcRect
- RectangleF
RectangleF que representa el rectángulo que se transforma en el paralelogramo definido por destPoints
.
Ejemplos
Para obtener un ejemplo, consulte Warp(PointF[], RectangleF, Matrix, WarpMode, Single).
Se aplica a
Warp(PointF[], RectangleF, Matrix)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Aplica una transformación de alabeo, definida por un rectángulo y un paralelogramo, a este trazado 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)
Parámetros
- destPoints
- PointF[]
Matriz de estructuras PointF que definen un paralelogramo en que se transforma el rectángulo definido por srcRect
. La matriz puede contener tres elementos o cuatro. Si la matriz contiene tres elementos, el ángulo inferior derecho del paralelogramo viene definido por los tres primeros puntos.
- srcRect
- RectangleF
RectangleF que representa el rectángulo que se transforma en el paralelogramo definido por destPoints
.
Ejemplos
Para obtener un ejemplo, consulte Warp(PointF[], RectangleF, Matrix, WarpMode, Single).
Se aplica a
Warp(PointF[], RectangleF, Matrix, WarpMode)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Aplica una transformación de alabeo, definida por un rectángulo y un paralelogramo, a este trazado 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)
Parámetros
- destPoints
- PointF[]
Matriz de estructuras PointF que define un paralelogramo en que se transforma el rectángulo definido por srcRect
. La matriz puede contener tres elementos o cuatro. Si la matriz contiene tres elementos, el ángulo inferior derecho del paralelogramo viene definido por los tres primeros puntos.
- srcRect
- RectangleF
RectangleF que representa el rectángulo que se transforma en el paralelogramo definido por destPoints
.
- warpMode
- WarpMode
Enumeración WarpMode que especifica si esta operación de alabeo usa el modo en perspectiva o bilineal.
Ejemplos
Para obtener un ejemplo, consulte Warp(PointF[], RectangleF, Matrix, WarpMode, Single).
Se aplica a
Warp(PointF[], RectangleF, Matrix, WarpMode, Single)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
Aplica una transformación de alabeo, definida por un rectángulo y un paralelogramo, a este trazado 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)
Parámetros
- destPoints
- PointF[]
Matriz de estructuras PointF que definen un paralelogramo en que se transforma el rectángulo definido por srcRect
. La matriz puede contener tres elementos o cuatro. Si la matriz contiene tres elementos, el ángulo inferior derecho del paralelogramo viene definido por los tres primeros puntos.
- srcRect
- RectangleF
RectangleF que representa el rectángulo que se transforma en el paralelogramo definido por destPoints
.
- warpMode
- WarpMode
Enumeración WarpMode que especifica si esta operación de alabeo usa el modo en perspectiva o bilineal.
- flatness
- Single
Valor de 0 a 1 que especifica cómo es de plano el trazado resultante. Para obtener más información, vea los métodos Flatten().
Ejemplos
El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse
, un OnPaint objeto de evento. El código realiza las siguientes acciones:
Crea una ruta de acceso y agrega un rectángulo a la ruta de acceso.
Dibuja ese rectángulo en la pantalla en negro.
Warps the path with a perspective warp.
Dibuja el rectángulo a la pantalla en rojo.
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
Se aplica a
Warp(ReadOnlySpan<PointF>, RectangleF, Matrix, WarpMode, Single)
- Source:
- 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)
Parámetros
- destPoints
- ReadOnlySpan<PointF>
- srcRect
- RectangleF
- matrix
- Matrix
- warpMode
- WarpMode
- flatness
- Single
Se aplica a
Comentarios
https://aka.ms/ContentUserFeedback.
Próximamente: A lo largo de 2024 iremos eliminando gradualmente las Cuestiones de GitHub como mecanismo de retroalimentación para el contenido y lo sustituiremos por un nuevo sistema de retroalimentación. Para más información, consulta:Enviar y ver comentarios de