Region.Xor Méthode

Définition

Met à jour cet objet Region avec l'union moins l'intersection de celui-ci et de l'objet GraphicsPath spécifié.

Surcharges

Xor(GraphicsPath)

Met à jour cet objet Region avec l'union moins l'intersection de celui-ci et du GraphicsPath spécifié.

Xor(Rectangle)

Met à jour cet objet Region avec l'union moins l'intersection de celui-ci et de la structure Rectangle spécifiée.

Xor(RectangleF)

Met à jour cet objet Region avec l'union moins l'intersection de celui-ci et de la structure RectangleF spécifiée.

Xor(Region)

Met à jour cet objet Region avec l'union moins l'intersection de celui-ci et du Region spécifié.

Xor(GraphicsPath)

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

Met à jour cet objet Region avec l'union moins l'intersection de celui-ci et du GraphicsPath spécifié.

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)

Paramètres

path
GraphicsPath

GraphicsPath à Xor avec cet objet Region.

Exceptions

path a la valeur null.

Exemples

Pour obtenir un exemple de code, consultez les Xor(RectangleF) méthodes et Complement(GraphicsPath) .

S’applique à

Xor(Rectangle)

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

Met à jour cet objet Region avec l'union moins l'intersection de celui-ci et de la structure Rectangle spécifiée.

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)

Paramètres

rect
Rectangle

Structure Rectangle à Xor avec cet objet Region.

Exemples

Pour obtenir un exemple de code, consultez la Xor(RectangleF) méthode .

S’applique à

Xor(RectangleF)

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

Met à jour cet objet Region avec l'union moins l'intersection de celui-ci et de la structure RectangleF spécifiée.

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)

Paramètres

rect
RectangleF

Structure RectangleF à Xor(GraphicsPath) avec cet objet Region.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse, qui est un paramètre du Paint gestionnaire d’événements. Le code effectue les actions suivantes :

  • Crée le premier rectangle et le dessine à l’écran en noir.

  • Crée un deuxième rectangle et le dessine vers l’écran en rouge.

  • Crée une région à l’aide du premier rectangle.

  • Obtient la Xor zone pour myRegion lorsqu’il est combiné avec complementRect.

  • Remplit la Xor zone de bleu et la dessine à l’écran.

Notez que les deux rectangles sont remplis de bleu, à l’exception de la zone de chevauchement.

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

S’applique à

Xor(Region)

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

Met à jour cet objet Region avec l'union moins l'intersection de celui-ci et du Region spécifié.

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)

Paramètres

region
Region

Region à Xor avec cet objet Region.

Exceptions

region a la valeur null.

Exemples

Pour obtenir un exemple de code, consultez les Xor(RectangleF) méthodes et Complement(GraphicsPath) .

S’applique à