다음을 통해 공유


LinearGradientBrush::SetTransform 메서드(gdiplusbrush.h)

LinearGradientBrush::SetTransform 메서드는 이 선형 그라데이션 브러시의 변환 행렬을 설정합니다.

구문

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

매개 변수

[in] matrix

형식: const Matrix*

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

반환 값

형식: 상태

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

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

설명

LinearGradientBrush 개체에는 그라데이션의 시작 및 끝 경계와 방향에 영향을 주는 모드 또는 각도를 지정하는 사각형이 있습니다. 브러시의 변환 행렬이 ID 이외의 변환을 나타내도록 설정된 경우 렌더링 중에 경계와 방향이 해당 행렬에 따라 변환됩니다.

변환은 렌더링 중에만 적용됩니다. LinearGradientBrush 개체에 의해 저장된 경계는 LinearGradientBrush::SetTransform 메서드에 의해 변경되지 않습니다.

예제

다음 예제에서는 선형 그라데이션 브러시를 만들고 이를 사용하여 사각형을 채웁니다. 다음으로, 코드는 브러시의 변환 매트릭스를 수정하고 변환된 브러시로 사각형을 채웁니다.

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

   LinearGradientBrush linGrBrush( 
      Rect(0, 0, 100, 50),
      Color(255, 255, 0, 0),  // red
      Color(255, 0, 0, 255),  // blue
      LinearGradientModeHorizontal);

   Matrix matrix(2.0, 0, 0, 1, 0, 0);  // horizontal doubling

   // Fill a large area with the linear gradient brush (no transformation).
   myGraphics.FillRectangle(&linGrBrush, 0, 0, 800, 50);

   linGrBrush.SetTransform(&matrix);

   // Fill a large area with the transformed linear gradient brush.
   myGraphics.FillRectangle(&linGrBrush, 0, 75, 800, 50);
}

요구 사항

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

추가 정보

브러시 및 채워진 도형

선형 그라데이션 만들기

그라데이션 브러시로 셰이프 채우기

LinearGradientBrush

LinearGradientBrush::GetTransform

LinearGradientBrush::ResetTransform

행렬

변환에 대한 매트릭스 표현

Rect

변환