Pen.ResetTransform Método
Definição
public:
void ResetTransform();
public void ResetTransform ();
member this.ResetTransform : unit -> unit
Public Sub ResetTransform ()
Exemplos
O exemplo de código a seguir foi projetado para uso com Windows Forms, e ele requer PaintEventArgs e , que é um parâmetro do Paint manipulador de eventos.The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. O código executa as seguintes ações:The code performs the following actions:
Define a matriz de transformação da caneta para escala 2 vezes na direção do eixo x.Sets the transformation matrix of the pen to scale 2 times in the x-axis direction.
Desenha uma linha na tela.Draws a line to the screen.
Redefine a matriz de transformação para identidade.Resets the transformation matrix to identity.
Desenha uma segunda linha para a tela.Draws a second line to the screen.
public:
void ResetTransform_Example( PaintEventArgs^ e )
{
// Create a Pen object.
Pen^ myPen = gcnew Pen( Color::Black,3.0f );
// Scale the transformation matrix of myPen.
myPen->ScaleTransform( 2, 1 );
// Draw a line with myPen.
e->Graphics->DrawLine( myPen, 10, 0, 10, 200 );
// Reset the transformation matrix of myPen to identity.
myPen->ResetTransform();
// Draw a second line with myPen.
e->Graphics->DrawLine( myPen, 100, 0, 100, 200 );
}
public void ResetTransform_Example(PaintEventArgs e)
{
// Create a Pen object.
Pen myPen = new Pen(Color.Black, 3);
// Scale the transformation matrix of myPen.
myPen.ScaleTransform(2, 1);
// Draw a line with myPen.
e.Graphics.DrawLine(myPen, 10, 0, 10, 200);
// Reset the transformation matrix of myPen to identity.
myPen.ResetTransform();
// Draw a second line with myPen.
e.Graphics.DrawLine(myPen, 100, 0, 100, 200);
}
Public Sub ResetTransform_Example(ByVal e As PaintEventArgs)
' Create a Pen object.
Dim myPen As New Pen(Color.Black, 3)
' Scale the transformation matrix of myPen.
myPen.ScaleTransform(2, 1)
' Draw a line with myPen.
e.Graphics.DrawLine(myPen, 10, 0, 10, 200)
' Reset the transformation matrix of myPen to identity.
myPen.ResetTransform()
' Draw a second line with myPen.
e.Graphics.DrawLine(myPen, 100, 0, 100, 200)
End Sub