다음을 통해 공유


PathGradientBrush::GetWrapMode 메서드(gdipluspath.h)

PathGradientBrush::GetWrapMode 메서드는 이 경로 그라데이션 브러시에 대해 현재 설정된 래핑 모드를 가져옵니다.

구문

WrapMode GetWrapMode();

반환 값

형식: WrapMode

이 메서드는 현재 이 경로 그라데이션 브러시에 대해 설정된 래핑 모드를 나타내는 WrapMode 열거형의 요소를 반환합니다.

설명

경로 그라데이션 브러시의 경계 사각형은 브러시의 경계 경로를 묶는 가장 작은 사각형입니다. 경로 그라데이션 브러시를 사용하여 경계 사각형을 그리면 경계 경로 내의 영역만 채워집니다. 경계 사각형 내의 영역이지만 경계 경로 외부는 채워지지 않습니다.

경로 그라데이션 브러시의 기본 래핑 모드는 WrapModeClamp이며, 이는 브러시의 경계 사각형 외부에서 그리는 일이 발생하지 않음을 나타냅니다. 다른 모든 래핑 모드는 브러시의 경계 사각형 외부 영역이 타일링됨을 나타냅니다. 각 타일은 경계 사각형 내부에 채워진 경로의 복사본(대칭 이동)입니다.

예제

다음 예제에서는 삼각형 경로를 기반으로 PathGradientBrush 개체를 만듭니다. 이 코드는 PathGradientBrush 개체의 PathGradientBrush::SetWrapMode 메서드를 호출하여 래핑 모드를 WrapModeTileFlipX로 설정합니다. 다음으로, 코드는 PathGradientBrush 개체의 PathGradientBrush::GetWrapMode 메서드를 호출하여 브러시의 래핑 모드를 가져옵니다. 가져온 래핑 모드가 WrapModeTileFlipX인 경우 코드는 FillRectangle 을 호출하여 경로 그라데이션 브러시가 있는 넓은 영역을 타일로 지정합니다.

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

   // Create a path gradient brush based on an array of points,
   // and set its wrap mode.
   Point points[] = {
      Point(0, 0), 
      Point(100, 0), 
      Point(100, 100)};

   Color colors[] = {
      Color(255, 255, 0, 0),   // red
      Color(255, 0, 0, 255),   // blue
      Color(255, 0, 255, 0)};  // green

   INT count = 3;

   PathGradientBrush pthGrBrush(points, 3);
   pthGrBrush.SetSurroundColors(colors, &count);
   pthGrBrush.SetWrapMode(WrapModeTileFlipX);

   // Obtain information about the path gradient brush.
   WrapMode wrapMode; 
   wrapMode = pthGrBrush.GetWrapMode();

   if(wrapMode == WrapModeTileFlipX)
         graphics.FillRectangle(&pthGrBrush, 0, 0, 800, 800);
}

요구 사항

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

참고 항목

브러시 및 채워진 도형

경로 그라데이션 만들기

도형에 색 그라데이션 채우기

PathGradientBrush

PathGradientBrush::SetWrapMode

이미지를 사용하여 도형 바둑판식 배열