Region.Union Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Aktualizuje to Region do samego związku i określonego GraphicsPathelementu .
Przeciążenia
| Nazwa | Opis |
|---|---|
| Union(GraphicsPath) |
Aktualizuje to Region do samego związku i określonego GraphicsPathelementu . |
| Union(Rectangle) |
Aktualizuje to Region do samego związku i określonej Rectangle struktury. |
| Union(RectangleF) |
Aktualizuje to Region do samego związku i określonej RectangleF struktury. |
| Union(Region) |
Aktualizuje to Region do samego związku i określonego Regionelementu . |
Union(GraphicsPath)
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
Aktualizuje to Region do samego związku i określonego GraphicsPathelementu .
public:
void Union(System::Drawing::Drawing2D::GraphicsPath ^ path);
public void Union(System.Drawing.Drawing2D.GraphicsPath path);
member this.Union : System.Drawing.Drawing2D.GraphicsPath -> unit
Public Sub Union (path As GraphicsPath)
Parametry
- path
- GraphicsPath
Element GraphicsPath , aby zjednoczyć się z tym Regionelementem .
Wyjątki
Parametr path ma wartość null.
Przykłady
Aby zapoznać się z przykładem kodu, zobacz Union(RectangleF) metody i Complement(GraphicsPath) .
Dotyczy
Union(Rectangle)
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
public:
void Union(System::Drawing::Rectangle rect);
public void Union(System.Drawing.Rectangle rect);
member this.Union : System.Drawing.Rectangle -> unit
Public Sub Union (rect As Rectangle)
Parametry
Przykłady
Aby zapoznać się z przykładem kodu, zobacz metodę Union(RectangleF) .
Dotyczy
Union(RectangleF)
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
Aktualizuje to Region do samego związku i określonej RectangleF struktury.
public:
void Union(System::Drawing::RectangleF rect);
public void Union(System.Drawing.RectangleF rect);
member this.Union : System.Drawing.RectangleF -> unit
Public Sub Union (rect As RectangleF)
Parametry
- rect
- RectangleF
Struktura do zjednoczenia RectangleF z tym Regionelementem .
Przykłady
Poniższy przykład kodu jest przeznaczony do użycia z Windows Forms i wymaga PaintEventArgse. Kod wykonuje następujące akcje:
Tworzy pierwszy prostokąt i rysuje go na ekranie w kolorze czarnym.
Tworzy drugi prostokąt i rysuje go na ekranie na czerwono.
Tworzy region przy użyciu pierwszego prostokąta.
Pobiera obszar unii dla
myRegionw połączeniu zcomplementRect.Wypełnia obszar unii niebieskim i rysuje go na ekranie.
Zwróć uwagę, że oba prostokąty są wypełnione kolorem niebieskim, w tym obszarem nakładania się.
void Union_RectF_Example( 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 unionRect = RectangleF(90,30,100,100);
e->Graphics->DrawRectangle( Pens::Red, Rectangle::Round( unionRect ) );
// Create a region using the first rectangle.
System::Drawing::Region^ myRegion = gcnew System::Drawing::Region( regionRect );
// Get the area of union for myRegion when combined with
// complementRect.
myRegion->Union( unionRect );
// Fill the union area of myRegion with blue.
SolidBrush^ myBrush = gcnew SolidBrush( Color::Blue );
e->Graphics->FillRegion( myBrush, myRegion );
}
public void Union_RectF_Example(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 unionRect = new RectangleF(90, 30, 100, 100);
e.Graphics.DrawRectangle(Pens.Red,
Rectangle.Round(unionRect));
// Create a region using the first rectangle.
Region myRegion = new Region(regionRect);
// Get the area of union for myRegion when combined with
// complementRect.
myRegion.Union(unionRect);
// Fill the union area of myRegion with blue.
SolidBrush myBrush = new SolidBrush(Color.Blue);
e.Graphics.FillRegion(myBrush, myRegion);
}
Public Sub Union_RectF_Example(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 unionRect As New RectangleF(90, 30, 100, 100)
e.Graphics.DrawRectangle(Pens.Red, Rectangle.Round(unionRect))
' Create a region using the first rectangle.
Dim myRegion As New [Region](regionRect)
' Get the area of union for myRegion when combined with
' complementRect.
myRegion.Union(unionRect)
' Fill the intersection area of myRegion with blue.
Dim myBrush As New SolidBrush(Color.Blue)
e.Graphics.FillRegion(myBrush, myRegion)
End Sub
Dotyczy
Union(Region)
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
- Źródło:
- Region.cs
public:
void Union(System::Drawing::Region ^ region);
public void Union(System.Drawing.Region region);
member this.Union : System.Drawing.Region -> unit
Public Sub Union (region As Region)
Parametry
Wyjątki
Parametr region ma wartość null.
Przykłady
Aby zapoznać się z przykładem kodu, zobacz metodę Union(RectangleF) and Complement(GraphicsPath) .