Graphics.TransformPoints 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이 Graphics의 현재 전체 및 페이지 변환을 사용하여 점의 배열을 하나의 좌표 공간에서 다른 좌표 공간으로 변환합니다.
오버로드
TransformPoints(CoordinateSpace, CoordinateSpace, Point[]) |
이 Graphics의 현재 전체 및 페이지 변환을 사용하여 점의 배열을 하나의 좌표 공간에서 다른 좌표 공간으로 변환합니다. |
TransformPoints(CoordinateSpace, CoordinateSpace, PointF[]) |
이 Graphics의 현재 전체 및 페이지 변환을 사용하여 점의 배열을 하나의 좌표 공간에서 다른 좌표 공간으로 변환합니다. |
TransformPoints(CoordinateSpace, CoordinateSpace, Point[])
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
이 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 열거형의 멤버입니다.
- srcSpace
- CoordinateSpace
소스 좌표 공간을 지정하는 CoordinateSpace 열거형의 멤버입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
두 점을 만들고 그 사이에 파란색 선을 그립니다.
월드 변환을 x 방향에서 40, y 방향으로 30으로 변환하도록 설정합니다.
세계 변환을 ID로 다시 설정합니다.
변환된 점 사이에 빨간색 선을 그립니다.
결과는 파란색 선과 그 아래에 변환된 빨간색 선입니다.
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[])
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
이 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 열거형의 멤버입니다.
- srcSpace
- CoordinateSpace
소스 좌표 공간을 지정하는 CoordinateSpace 열거형의 멤버입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
두 점을 만들고 그 사이에 파란색 선을 그립니다.
월드 변환을 x 방향에서 40, y 방향으로 30으로 변환하도록 설정합니다.
세계 변환을 ID로 다시 설정하고 변환된 점 사이에 빨간색 선을 그립니다.
결과는 파란색 선과 그 아래에 변환된 빨간색 선입니다.
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
적용 대상
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기