Region::Xor(constRect&) 메서드(gdiplusheaders.h)

Region::Xor 메서드는 이 지역을 자체의 비연속 부분과 지정된 사각형의 내부로 업데이트합니다.

구문

Status Xor(
  const Rect & rect
);

매개 변수

rect

이 지역을 업데이트하는 데 사용할 사각형에 대한 참조입니다.

반환 값

형식: 상태

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

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

설명

예제

다음 예제에서는 경로에서 영역을 만든 다음 사각형을 사용하여 지역을 업데이트합니다.

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

   Rect rect(65, 15, 70, 45);
   GraphicsPath path;
   SolidBrush solidBrush(Color(255, 255, 0, 0));

   path.AddClosedCurve(points, 6);

   // Create a region from a path.
   Region pathRegion(&path);

   // Perform an exclusive OR operation on the region and a rectangle.
   pathRegion.Xor(rect);

   graphics.FillRegion(&solidBrush, &pathRegion);
}

요구 사항

   
머리글 gdiplusheaders.h

추가 정보

지역

Rect

상태