다음을 통해 공유


Pen::SetTransform 메서드(gdipluspen.h)

Pen::SetTransform 메서드는 이 Pen 개체의 월드 변환을 설정합니다.

구문

Status SetTransform(
  [in] const Matrix *matrix
);

매개 변수

[in] matrix

형식: const Matrix*

월드 변환을 지정하는 Matrix 개체에 대한 포인터입니다.

반환 값

형식: 상태

메서드가 성공하면 Status 열거형의 요소인 Ok를 반환합니다.

메서드가 실패하면 Status 열거형의 다른 요소 중 하나를 반환합니다.

설명

이 메서드는 Matrix 개체의 변환 부분을 무시합니다.

예제

다음 예제에서는 배율 행렬과 Pen 개체를 만든 다음 사각형을 그립니다. 그런 다음, 코드는 행렬에 따라 펜의 크기를 조정하고 두 번째 사각형을 그립니다.

VOID Example_SetTransform(HDC hdc)
{
   Graphics graphics(hdc);

   Matrix matrix(20, 0, 0, 10, 0, 0);  // scale

   // Create a pen, and use it to draw a rectangle.
   Pen pen(Color(255, 0, 0, 255), 2);
   graphics.DrawRectangle(&pen, 10, 50, 150, 100);

   // Scale the pen width by a factor of 20 in the horizontal 
   // direction and a factor of 10 in the vertical direction.
   pen.SetTransform(&matrix);

   // Draw a rectangle with the transformed pen.
   graphics.DrawRectangle(&pen, 200, 50, 150, 100);
}

요구 사항

   
지원되는 최소 클라이언트 Windows XP, Windows 2000 Professional [데스크톱 앱만 해당]
지원되는 최소 서버 Windows 2000 Server[데스크톱 앱만]
대상 플랫폼 Windows
헤더 gdipluspen.h(Gdiplus.h 포함)
라이브러리 Gdiplus.lib
DLL Gdiplus.dll

참고 항목

좌표계 및 변환

행렬

펜::GetTransform

펜::MultiplyTransform

펜::ResetTransform

펜::RotateTransform

펜::ScaleTransform

변환