Share via


Region.Xor 메서드

정의

교차 부분을 제외하고 지정된 Region 개체와 통합되게 이 GraphicsPath 개체를 업데이트합니다.

오버로드

Xor(GraphicsPath)

교차 부분을 제외하고 지정된 Region와 통합되게 이 GraphicsPath을 업데이트합니다.

Xor(Rectangle)

교차 부분을 제외하고 지정된 Region 구조체와 통합되게 이 Rectangle을 업데이트합니다.

Xor(RectangleF)

교차 부분을 제외하고 지정된 Region 구조체와 통합되게 이 RectangleF을 업데이트합니다.

Xor(Region)

교차 부분을 제외하고 지정된 Region와 통합되게 이 Region을 업데이트합니다.

Xor(GraphicsPath)

Source:
Region.cs
Source:
Region.cs
Source:
Region.cs

교차 부분을 제외하고 지정된 Region와 통합되게 이 GraphicsPath을 업데이트합니다.

public:
 void Xor(System::Drawing::Drawing2D::GraphicsPath ^ path);
public void Xor (System.Drawing.Drawing2D.GraphicsPath path);
member this.Xor : System.Drawing.Drawing2D.GraphicsPath -> unit
Public Sub Xor (path As GraphicsPath)

매개 변수

path
GraphicsPath

GraphicsPathXor하는 Region입니다.

예외

path이(가) null인 경우

예제

코드 예제는 및 Complement(GraphicsPath) 메서드를 Xor(RectangleF) 참조하세요.

적용 대상

Xor(Rectangle)

Source:
Region.cs
Source:
Region.cs
Source:
Region.cs

교차 부분을 제외하고 지정된 Region 구조체와 통합되게 이 Rectangle을 업데이트합니다.

public:
 void Xor(System::Drawing::Rectangle rect);
public void Xor (System.Drawing.Rectangle rect);
member this.Xor : System.Drawing.Rectangle -> unit
Public Sub Xor (rect As Rectangle)

매개 변수

rect
Rectangle

RectangleXor하는 Region 구조체입니다.

예제

코드 예제는 메서드를 참조하세요 Xor(RectangleF) .

적용 대상

Xor(RectangleF)

Source:
Region.cs
Source:
Region.cs
Source:
Region.cs

교차 부분을 제외하고 지정된 Region 구조체와 통합되게 이 RectangleF을 업데이트합니다.

public:
 void Xor(System::Drawing::RectangleF rect);
public void Xor (System.Drawing.RectangleF rect);
member this.Xor : System.Drawing.RectangleF -> unit
Public Sub Xor (rect As RectangleF)

매개 변수

rect
RectangleF

RectangleFXor(GraphicsPath)하는 Region 구조체입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • 첫 번째 사각형을 만들고 검은색으로 화면에 그립니다.

  • 두 번째 사각형을 만들고 빨간색으로 화면에 그립니다.

  • 첫 번째 사각형을 사용하여 영역을 만듭니다.

  • complementRect결합된 Xor 경우 의 myRegion 영역을 가져옵니다.

  • Xor 영역을 파란색으로 채우고 화면에 그립니다.

두 사각형은 겹치는 영역을 제외하고 파란색으로 채워집니다.

void XorExample( PaintEventArgs^ e )
{
   // Create the first rectangle and draw it to the screen in black.
   Rectangle regionRect = Rectangle(20,20,100,100);
   e->Graphics->DrawRectangle( Pens::Black, regionRect );

   // create the second rectangle and draw it to the screen in red.
   RectangleF xorRect = RectangleF(90,30,100,100);
   e->Graphics->DrawRectangle( Pens::Red, Rectangle::Round( xorRect ) );

   // Create a region using the first rectangle.
   System::Drawing::Region^ myRegion = gcnew System::Drawing::Region( regionRect );

   // Get the area of overlap for myRegion when combined with
   // complementRect.
   myRegion->Xor( xorRect );

   // Fill the Xor area of myRegion with blue.
   SolidBrush^ myBrush = gcnew SolidBrush( Color::Blue );
   e->Graphics->FillRegion( myBrush, myRegion );
}
public void XorExample(PaintEventArgs e)
{
             
    // Create the first rectangle and draw it to the screen in black.
    Rectangle regionRect = new Rectangle(20, 20, 100, 100);
    e.Graphics.DrawRectangle(Pens.Black, regionRect);
             
    // create the second rectangle and draw it to the screen in red.
    RectangleF xorRect = new RectangleF(90, 30, 100, 100);
    e.Graphics.DrawRectangle(Pens.Red,
        Rectangle.Round(xorRect));
             
    // Create a region using the first rectangle.
    Region myRegion = new Region(regionRect);
             
    // Get the area of overlap for myRegion when combined with
             
    // complementRect.
    myRegion.Xor(xorRect);
             
    // Fill the Xor area of myRegion with blue.
    SolidBrush myBrush = new SolidBrush(Color.Blue);
    e.Graphics.FillRegion(myBrush, myRegion);
}
Public Sub XorExample(ByVal e As PaintEventArgs)

    ' Create the first rectangle and draw it to the screen in black.
    Dim regionRect As New Rectangle(20, 20, 100, 100)
    e.Graphics.DrawRectangle(Pens.Black, regionRect)

    ' create the second rectangle and draw it to the screen in red.
    Dim xorRect As New RectangleF(90, 30, 100, 100)
    e.Graphics.DrawRectangle(Pens.Red, Rectangle.Round(xorRect))

    ' Create a region using the first rectangle.
    Dim myRegion As New [Region](regionRect)

    ' Get the area of overlap for myRegion when combined with
    ' complementRect.
    myRegion.Xor(xorRect)

    ' Fill the intersection area of myRegion with blue.
    Dim myBrush As New SolidBrush(Color.Blue)
    e.Graphics.FillRegion(myBrush, myRegion)
End Sub

적용 대상

Xor(Region)

Source:
Region.cs
Source:
Region.cs
Source:
Region.cs

교차 부분을 제외하고 지정된 Region와 통합되게 이 Region을 업데이트합니다.

public:
 void Xor(System::Drawing::Region ^ region);
public void Xor (System.Drawing.Region region);
member this.Xor : System.Drawing.Region -> unit
Public Sub Xor (region As Region)

매개 변수

region
Region

RegionXor하는 Region입니다.

예외

region이(가) null인 경우

예제

코드 예제는 및 Complement(GraphicsPath) 메서드를 Xor(RectangleF) 참조하세요.

적용 대상