Region.Xor 메서드

정의

Region 개체를 지정된 GraphicsPath 개체와의 교집합을 뺀 합집합으로 업데이트합니다.

오버로드

Name Description
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
Source:
Region.cs
Source:
Region.cs
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 수 있습니다.

예외

pathnull입니다.

예제

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

적용 대상

Xor(Rectangle)

Source:
Region.cs
Source:
Region.cs
Source:
Region.cs
Source:
Region.cs
Source:
Region.cs
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
Source:
Region.cs
Source:
Region.cs
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 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.

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

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

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

  • 와 결합할 Xor 때의 myRegion 영역을 가져옵니다 complementRect.

  • 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
Source:
Region.cs
Source:
Region.cs
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 수 있습니다.

예외

regionnull입니다.

예제

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

적용 대상