Region.Xor Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Actualiza este objeto Region a la unión de él mismo, menos la intersección, con el objeto GraphicsPath especificado.
Sobrecargas
Xor(GraphicsPath) |
Actualiza esta Region a la unión de ella misma, menos la intersección, con el objeto GraphicsPath especificado. |
Xor(Rectangle) |
Actualiza esta Region a la unión de ella misma, menos la intersección, con la estructura Rectangle especificada. |
Xor(RectangleF) |
Actualiza esta Region a la unión de ella misma, menos la intersección, con la estructura RectangleF especificada. |
Xor(Region) |
Actualiza esta Region a la unión de ella misma, menos la intersección, con el objeto Region especificado. |
Xor(GraphicsPath)
- Source:
- Region.cs
- Source:
- Region.cs
- Source:
- Region.cs
Actualiza esta Region a la unión de ella misma, menos la intersección, con el objeto GraphicsPath especificado.
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)
Parámetros
- path
- GraphicsPath
GraphicsPath al que se va a aplicar Xor con esta Region.
Excepciones
path
es null
.
Ejemplos
Para obtener un ejemplo de código, consulte los Xor(RectangleF) métodos y Complement(GraphicsPath) .
Se aplica a
Xor(Rectangle)
- Source:
- Region.cs
- Source:
- Region.cs
- Source:
- Region.cs
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)
Parámetros
Ejemplos
Para obtener un ejemplo de código, vea el Xor(RectangleF) método .
Se aplica a
Xor(RectangleF)
- Source:
- Region.cs
- Source:
- Region.cs
- Source:
- Region.cs
Actualiza esta Region a la unión de ella misma, menos la intersección, con la estructura RectangleF especificada.
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)
Parámetros
- rect
- RectangleF
Estructura RectangleF a la que se va a aplicar Xor(GraphicsPath) con esta Region.
Ejemplos
El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse
, que es un parámetro del Paint controlador de eventos. El código realiza las siguientes acciones:
Crea el primer rectángulo y lo dibuja en la pantalla en negro.
Crea un segundo rectángulo y lo dibuja en la pantalla en rojo.
Crea una región con el primer rectángulo.
Obtiene el Xor área para
myRegion
cuando se combina concomplementRect
.Rellena el Xor área con azul y la dibuja en la pantalla.
Observe que ambos rectángulos se rellenan con azul, excepto el área de superposición.
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
Se aplica a
Xor(Region)
- Source:
- Region.cs
- Source:
- Region.cs
- Source:
- Region.cs
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)
Parámetros
Excepciones
region
es null
.
Ejemplos
Para obtener un ejemplo de código, consulte los Xor(RectangleF) métodos y Complement(GraphicsPath) .
Se aplica a
Comentarios
https://aka.ms/ContentUserFeedback.
Próximamente: A lo largo de 2024 iremos eliminando gradualmente GitHub Issues como mecanismo de comentarios sobre el contenido y lo sustituiremos por un nuevo sistema de comentarios. Para más información, vea:Enviar y ver comentarios de