이 예제에서는 Matrix을 사용하여 Point와 Vector 개체를 변환하는 방법을 보여줍니다.
예시
private void transformExamples()
{
Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
//
// Transform a point.
//
Point myPoint = new Point(15,25);
// pointResult is (475, 680).
Point pointResult = myMatrix.Transform(myPoint);
//
// Transform an array of points.
//
Point[] myPointArray = new Point[]
{new Point(15,25), new Point(30,35)};
// myPointArray[0] becomes (475, 680).
// myPointArray[1] becomes (700, 1030).
myMatrix.Transform(myPointArray);
//
// Transform a vector.
//
Vector myVector = new Vector(15,25);
// vectorResult becomes (450, 650).
Vector vectorResult = myMatrix.Transform(myVector);
//
// Transform an array of vectors.
//
Vector[] myVectorArray = new Vector[]
{new Vector(15, 25), new Vector(30,35)};
// myVectorArray[0] becomes (450, 650).
// myVectorArray[1] becomes (675, 1000).
myMatrix.Transform(myVectorArray);
}
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET Desktop feedback