Region::GetBounds(RectF*,constGraphics*) 메서드(gdiplusheaders.h)

Region::GetBounds 메서드는 이 지역을 둘러싸는 사각형을 가져옵니다.

구문

Status GetBounds(
  [out] RectF          *rect,
  [in]  const Graphics *g
);

매개 변수

[out] rect

형식: RectF*

바깥쪽 사각형을 수신하는 RectF 개체에 대한 포인터입니다.

[in] g

형식: const 그래픽*

이 영역 및 사각형의 디바이스 좌표를 계산하는 데 필요한 월드 및 페이지 변환을 포함하는 Graphics 개체에 대한 포인터입니다.

반환 값

형식: 상태

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

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

설명

그래픽 개체의 현재 세계 및 페이지 변환은 디스플레이 디바이스에 그려질 때 영역과 사각형을 계산하는 데 사용됩니다. Region::GetBounds에서 반환된 사각형이 항상 가능한 가장 작은 사각형은 아닙니다.

예제

다음 예제에서는 경로에서 영역을 만들고 영역의 바깥쪽 사각형을 가져오고 두 영역을 모두 표시합니다.

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

   Point points[] = {
      Point(110, 20),
      Point(120, 30),
      Point(100, 60),
      Point(120, 70),
      Point(150, 60),
      Point(140, 10)};

   GraphicsPath path;
    SolidBrush solidBrush(Color(255, 255, 0, 0));
    Pen pen(Color(255, 0, 0, 0));
    RectF rect;

   path.AddClosedCurve(points, 6);

    // Create a region from a path.
    Region pathRegion(&path);
    
    // Get the region's enclosing rectangle.
    pathRegion.GetBounds(&rect, &graphics);

    // Show the region and the enclosing rectangle.
    graphics.FillRegion(&solidBrush, &pathRegion);
    graphics.DrawRectangle(&pen, rect);
}

요구 사항

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

추가 정보

Graphicspath

지역