Graphics.TransformPoints Graphics.TransformPoints Graphics.TransformPoints Graphics.TransformPoints Method

정의

Graphics의 현재 전체 및 페이지 변환을 사용하여 점의 배열을 하나의 좌표 공간에서 다른 좌표 공간으로 변환합니다.Transforms an array of points from one coordinate space to another using the current world and page transformations of this Graphics.

오버로드

TransformPoints(CoordinateSpace, CoordinateSpace, Point[]) TransformPoints(CoordinateSpace, CoordinateSpace, Point[]) TransformPoints(CoordinateSpace, CoordinateSpace, Point[]) TransformPoints(CoordinateSpace, CoordinateSpace, Point[])

Graphics의 현재 전체 및 페이지 변환을 사용하여 점의 배열을 하나의 좌표 공간에서 다른 좌표 공간으로 변환합니다.Transforms an array of points from one coordinate space to another using the current world and page transformations of this Graphics.

TransformPoints(CoordinateSpace, CoordinateSpace, PointF[]) TransformPoints(CoordinateSpace, CoordinateSpace, PointF[]) TransformPoints(CoordinateSpace, CoordinateSpace, PointF[]) TransformPoints(CoordinateSpace, CoordinateSpace, PointF[])

Graphics의 현재 전체 및 페이지 변환을 사용하여 점의 배열을 하나의 좌표 공간에서 다른 좌표 공간으로 변환합니다.Transforms an array of points from one coordinate space to another using the current world and page transformations of this Graphics.

TransformPoints(CoordinateSpace, CoordinateSpace, Point[]) TransformPoints(CoordinateSpace, CoordinateSpace, Point[]) TransformPoints(CoordinateSpace, CoordinateSpace, Point[]) TransformPoints(CoordinateSpace, CoordinateSpace, Point[])

Graphics의 현재 전체 및 페이지 변환을 사용하여 점의 배열을 하나의 좌표 공간에서 다른 좌표 공간으로 변환합니다.Transforms an array of points from one coordinate space to another using the current world and page transformations of this Graphics.

public:
 void TransformPoints(System::Drawing::Drawing2D::CoordinateSpace destSpace, System::Drawing::Drawing2D::CoordinateSpace srcSpace, cli::array <System::Drawing::Point> ^ pts);
public void TransformPoints (System.Drawing.Drawing2D.CoordinateSpace destSpace, System.Drawing.Drawing2D.CoordinateSpace srcSpace, System.Drawing.Point[] pts);
member this.TransformPoints : System.Drawing.Drawing2D.CoordinateSpace * System.Drawing.Drawing2D.CoordinateSpace * System.Drawing.Point[] -> unit
Public Sub TransformPoints (destSpace As CoordinateSpace, srcSpace As CoordinateSpace, pts As Point())

매개 변수

destSpace
CoordinateSpace CoordinateSpace CoordinateSpace CoordinateSpace

대상 좌표 공간을 지정하는 CoordinateSpace 열거형의 멤버입니다.Member of the CoordinateSpace enumeration that specifies the destination coordinate space.

srcSpace
CoordinateSpace CoordinateSpace CoordinateSpace CoordinateSpace

소스 좌표 공간을 지정하는 CoordinateSpace 열거형의 멤버입니다.Member of the CoordinateSpace enumeration that specifies the source coordinate space.

pts
Point[]

변환할 점을 나타내는 Point 구조체의 배열입니다.Array of Point structures that represents the points to transformation.

예제

다음 코드 예제는 Windows Forms에서 사용 하도록 설계 되었으며 필요 PaintEventArgs e의 매개 변수는 Paint 이벤트 처리기입니다.The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 이 코드에서는 다음 작업을 수행합니다.The code performs the following actions:

  • 두 개의 점을 만들고 해당 사이 파란색 선을 그립니다.Creates two points and draws a blue line between them.

  • X 방향 및 y 방향의 30 40 양만큼 변환할 world 변환을 설정 합니다.Sets the world transform to translate by amounts 40 in the x direction and 30 in the y direction.

  • 세계 좌표에서 요소를 변환 (World)를 페이지 좌표로 (Page).Transforms the points from world coordinates (World) to page coordinates (Page).

  • 월드 id로 다시 설정합니다.Resets the world transformation to the identity.

  • 변환 된 점 사이의 빨강 선을 그립니다.Draws a red line between the transformed points.

결과 파란색 선 및 번역 된 빨간색 줄 아래입니다.The result is a blue line and a translated red line below it.

public:
   void TransformPointsPoint( PaintEventArgs^ e )
   {
      // Create array of two points.
      array<Point>^ points = {Point(0,0),Point(100,50)};

      // Draw line connecting two untransformed points.
      e->Graphics->DrawLine( gcnew Pen( Color::Blue,3.0f ), points[ 0 ], points[ 1 ] );

      // Set world transformation of Graphics object to translate.
      e->Graphics->TranslateTransform( 40, 30 );

      // Transform points in array from world to page coordinates.
      e->Graphics->TransformPoints( CoordinateSpace::Page, CoordinateSpace::World, points );

      // Reset world transformation.
      e->Graphics->ResetTransform();

      // Draw line that connects transformed points.
      e->Graphics->DrawLine( gcnew Pen( Color::Red,3.0f ), points[ 0 ], points[ 1 ] );
   }
private void TransformPointsPoint(PaintEventArgs e)
{

    // Create array of two points.
    Point[] points = { new Point(0, 0), new Point(100, 50) };

    // Draw line connecting two untransformed points.
    e.Graphics.DrawLine(new Pen(Color.Blue, 3), points[0], points[1]);

    // Set world transformation of Graphics object to translate.
    e.Graphics.TranslateTransform(40, 30);

    // Transform points in array from world to page coordinates.
    e.Graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.World, points);

    // Reset world transformation.
    e.Graphics.ResetTransform();

    // Draw line that connects transformed points.
    e.Graphics.DrawLine(new Pen(Color.Red, 3), points[0], points[1]);
}
Private Sub TransformPointsPoint(ByVal e As PaintEventArgs)

    ' Create array of two points.
    Dim points As Point() = {New Point(0, 0), New Point(100, 50)}

    ' Draw line connecting two untransformed points.
    e.Graphics.DrawLine(New Pen(Color.Blue, 3), points(0), points(1))

    ' Set world transformation of Graphics object to translate.
    e.Graphics.TranslateTransform(40, 30)

    ' Transform points in array from world to page coordinates.
    e.Graphics.TransformPoints(CoordinateSpace.Page, _
    CoordinateSpace.World, points)

    ' Reset world transformation.
    e.Graphics.ResetTransform()

    ' Draw line that connects transformed points.
    e.Graphics.DrawLine(New Pen(Color.Red, 3), points(0), points(1))
End Sub

TransformPoints(CoordinateSpace, CoordinateSpace, PointF[]) TransformPoints(CoordinateSpace, CoordinateSpace, PointF[]) TransformPoints(CoordinateSpace, CoordinateSpace, PointF[]) TransformPoints(CoordinateSpace, CoordinateSpace, PointF[])

Graphics의 현재 전체 및 페이지 변환을 사용하여 점의 배열을 하나의 좌표 공간에서 다른 좌표 공간으로 변환합니다.Transforms an array of points from one coordinate space to another using the current world and page transformations of this Graphics.

public:
 void TransformPoints(System::Drawing::Drawing2D::CoordinateSpace destSpace, System::Drawing::Drawing2D::CoordinateSpace srcSpace, cli::array <System::Drawing::PointF> ^ pts);
public void TransformPoints (System.Drawing.Drawing2D.CoordinateSpace destSpace, System.Drawing.Drawing2D.CoordinateSpace srcSpace, System.Drawing.PointF[] pts);
member this.TransformPoints : System.Drawing.Drawing2D.CoordinateSpace * System.Drawing.Drawing2D.CoordinateSpace * System.Drawing.PointF[] -> unit
Public Sub TransformPoints (destSpace As CoordinateSpace, srcSpace As CoordinateSpace, pts As PointF())

매개 변수

destSpace
CoordinateSpace CoordinateSpace CoordinateSpace CoordinateSpace

대상 좌표 공간을 지정하는 CoordinateSpace 열거형의 멤버입니다.Member of the CoordinateSpace enumeration that specifies the destination coordinate space.

srcSpace
CoordinateSpace CoordinateSpace CoordinateSpace CoordinateSpace

소스 좌표 공간을 지정하는 CoordinateSpace 열거형의 멤버입니다.Member of the CoordinateSpace enumeration that specifies the source coordinate space.

pts
PointF[]

변환할 점을 나타내는 PointF 구조체의 배열입니다.Array of PointF structures that represent the points to transform.

예제

다음 코드 예제는 Windows Forms에서 사용 하도록 설계 되었으며 필요 PaintEventArgs e의 매개 변수는 Paint 이벤트 처리기입니다.The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 이 코드에서는 다음 작업을 수행합니다.The code performs the following actions:

  • 두 개의 점을 만들고 해당 사이 파란색 선을 그립니다.Creates two points and draws a blue line between them.

  • X 방향 및 y 방향의 30 40 양만큼 변환할 world 변환을 설정 합니다.Sets the world transform to translate by amounts 40 in the x direction and 30 in the y direction.

  • 세계 좌표에서 요소를 변환 (World)를 페이지 좌표로 (Page).Transforms the points from world coordinates (World) to page coordinates (Page).

  • 월드 id로 다시 설정 하 고 변환된 된 점 사이 빨간색 선을 그립니다.Resets the world transformation to the identity and draws a red line between the transformed points.

결과 파란색 선 및 번역 된 빨간색 줄 아래입니다.The result is a blue line and a translated red line below it.

public:
   void TransformPointsPointF( PaintEventArgs^ e )
   {
      // Create array of two points.
      array<PointF>^ points = {PointF(0.0F,0.0F),PointF(100.0F,50.0F)};

      // Draw line connecting two untransformed points.
      e->Graphics->DrawLine( gcnew Pen( Color::Blue,3.0f ), points[ 0 ], points[ 1 ] );

      // Set world transformation of Graphics object to translate.
      e->Graphics->TranslateTransform( 40.0F, 30.0F );

      // Transform points in array from world to page coordinates.
      e->Graphics->TransformPoints( CoordinateSpace::Page, CoordinateSpace::World, points );

      // Reset world transformation.
      e->Graphics->ResetTransform();

      // Draw line that connects transformed points.
      e->Graphics->DrawLine( gcnew Pen( Color::Red,3.0f ), points[ 0 ], points[ 1 ] );
   }
private void TransformPointsPointF(PaintEventArgs e)
{

    // Create array of two points.
    PointF[] points = { new PointF(0.0F, 0.0F), new PointF(100.0F, 50.0F) };

    // Draw line connecting two untransformed points.
    e.Graphics.DrawLine(new Pen(Color.Blue, 3), points[0], points[1]);

    // Set world transformation of Graphics object to translate.
    e.Graphics.TranslateTransform(40.0F, 30.0F);

    // Transform points in array from world to page coordinates.
    e.Graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.World, points);

    // Reset world transformation.
    e.Graphics.ResetTransform();

    // Draw line that connects transformed points.
    e.Graphics.DrawLine(new Pen(Color.Red, 3), points[0], points[1]);
}
Private Sub TransformPointsPointF(ByVal e As PaintEventArgs)

    ' Create array of two points.
    Dim points As PointF() = {New PointF(0.0F, 0.0F), New PointF(100.0F, _
    50.0F)}

    ' Draw line connecting two untransformed points.
    e.Graphics.DrawLine(New Pen(Color.Blue, 3), points(0), points(1))

    ' Set world transformation of Graphics object to translate.
    e.Graphics.TranslateTransform(40.0F, 30.0F)

    ' Transform points in array from world to page coordinates.
    e.Graphics.TransformPoints(CoordinateSpace.Page, _
    CoordinateSpace.World, points)

    ' Reset world transformation.
    e.Graphics.ResetTransform()

    ' Draw line that connects transformed points.
    e.Graphics.DrawLine(New Pen(Color.Red, 3), points(0), points(1))
End Sub

적용 대상