Share via


Region::IsVisible(INT,INT,INT,INT,constGraphics*) 메서드(gdiplusheaders.h)

Region::IsVisible 메서드는 사각형이 이 지역과 교차하는지 여부를 결정합니다.

구문

BOOL IsVisible(
  [in] INT            x,
  [in] INT            y,
  [in] INT            width,
  [in] INT            height,
  [in] const Graphics *g
);

매개 변수

[in] x

형식: INT

테스트할 사각형의 왼쪽 위 모서리의 x 좌표를 지정하는 정수입니다.

[in] y

형식: INT

테스트할 사각형의 왼쪽 위 모서리의 y 좌표를 지정하는 정수입니다.

[in] width

형식: INT

테스트할 사각형의 너비를 지정하는 정수입니다.

[in] height

형식: INT

테스트할 사각형의 높이를 지정하는 정수입니다.

[in] g

형식: const 그래픽*

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

반환 값

형식: BOOL

사각형이 이 영역과 교차하는 경우 메서드는 TRUE를 반환합니다. 그렇지 않으면 FALSE를 반환 합니다.

설명

참고 영역에 테두리가 포함됩니다.
 

예제

다음 예제에서는 경로에서 영역을 만든 다음, 사각형이 지역과 교차하는지 여부를 테스트합니다.

VOID Example_IsVisibleXYWH(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));

   path.AddClosedCurve(points, 6);

   // Create a region from a path.
   Region pathRegion(&path);
   graphics.FillRegion(&solidBrush, &pathRegion);

   // Check to see whether the rectangle intersects the region.
   // The rectangle has upper-left corner (65, 25), width 70, and height 30.
   if(pathRegion.IsVisible(65, 25, 70, 30, &graphics))
   {
      // All or part of the rectangle is in the region.
   }

   // Draw the rectangle.
   Pen pen(Color(255, 0, 0, 0));
   graphics.DrawRectangle(&pen, 65, 25, 70, 30);
}

요구 사항

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

추가 정보

그래픽

Rect

지역