Graphics::GetClipBounds(RectF*) 메서드(gdiplusgraphics.h)

Graphics::GetClipBounds 메서드는 이 Graphics 개체의 클리핑 영역을 묶는 사각형을 가져옵니다.

구문

Status GetClipBounds(
  RectF *rect
);

매개 변수

rect

클리핑 영역을 묶는 사각형을 수신하는 RectF 개체에 대한 포인터입니다.

반환 값

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

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

설명

월드 변환이 클리핑 영역에 적용된 다음, 바깥쪽 사각형이 계산됩니다.

Graphics 개체의 클리핑 영역을 명시적으로 설정하지 않으면 해당 클리핑 영역은 무한합니다. 클리핑 영역이 무한하면 Graphics::GetClipBounds 는 큰 사각형을 반환합니다. 해당 사각형의 X 및 Y 데이터 멤버는 큰 음수이고 WidthHeight 데이터 멤버는 양수입니다.

예제

다음은 클리핑 영역을 설정하고 클리핑 영역을 묶는 사각형을 가져오고 사각형을 채우는 예제입니다.

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

   Region   myRegion(RectF(25.0f, 25.0f, 100.0f, 50.0f));
   RectF    rect(40.0f, 60.0f, 100.0f, 50.0f);
   Region   gRegion;
   RectF    enclosingRect;

   SolidBrush  blueBrush(Color(100, 0, 0, 255));
   Pen         greenPen(Color(255, 0, 255, 0), 1.5f);

   // Modify the region by using a rectangle.
   myRegion.Union(rect);

   // Set the clipping region of the graphics object.
   graphics.SetClip(&myRegion);

   // Now, get the clipping region, and fill it
   graphics.GetClip(&gRegion);
   graphics.FillRegion(&blueBrush, &gRegion);

   // Get a rectangle that encloses the clipping region, and draw the enclosing
   // rectangle.
   graphics.GetClipBounds(&enclosingRect);
   graphics.ResetClip();
   graphics.DrawRectangle(&greenPen, enclosingRect);}

요구 사항

요구 사항
헤더 gdiplusgraphics.h

추가 정보

클리핑

지역을 사용하여 클리핑

GetVisibleClipBounds 메서드

그래픽

그래픽::GetClip

RectF

SetClip 메서드

상태