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

Region::IsVisible 메서드는 지점이 이 지역 내에 있는지 여부를 결정합니다.

구문

BOOL IsVisible(
  INT            x,
  INT            y,
  const Graphics *g
);

매개 변수

x

테스트할 지점의 x 좌표를 지정하는 정수입니다.

y

테스트할 지점의 y 좌표를 지정하는 정수입니다.

g

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

반환 값

형식: 상태

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

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

설명

예제

다음 예제에서는 경로에서 영역을 만든 다음, 지점이 지역 내에 있는지 여부를 확인하기 위해 테스트합니다.

VOID Example_IsVisibleXY(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 point (125, 40) is in the region.
   INT x = 125;
   INT y = 40;
   if(pathRegion.IsVisible(x, y, &graphics))
   {

      // The point is in the region.
   }

   // Fill a small circle centered at the point (125, 40).
   SolidBrush brush(Color(255, 0, 0, 0));
   graphics.FillEllipse(&brush, x - 4, y - 4, 8, 8);
}

요구 사항

   
머리글 gdiplusheaders.h

참고 항목

지역

Rect

상태