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

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

구문

BOOL IsVisible(
  [in, ref] const Rect &   rect,
  [in]      const Graphics *g
);

매개 변수

[in, ref] rect

형식: const Rect

테스트할 사각형에 대한 참조입니다.

[in] g

형식: const 그래픽*

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

반환 값

형식: BOOL

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

설명

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

예제

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

VOID Example_IsVisibleRect(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 a rectangle intersects the region.
   Rect testRect(65, 25, 70, 30);

   if(pathRegion.IsVisible(testRect, &graphics))
   {
      // All or part of the rectangle is in the region.
   }

   // Draw the test rectangle.
   Pen pen(Color(255, 0, 0, 0));
   graphics.DrawRectangle(&pen, testRect);
}

요구 사항

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

추가 정보

그래픽

Point

지역