Region.Union Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Aktualizuje to Region na sjednocování samotného a zadaného GraphicsPath.
Přetížení
| Name | Description |
|---|---|
| Union(GraphicsPath) |
Aktualizuje to Region na sjednocování samotného a zadaného GraphicsPath. |
| Union(Rectangle) |
Aktualizuje to Region na sjednocování sebe sama a zadanou Rectangle strukturu. |
| Union(RectangleF) |
Aktualizuje to Region na sjednocování sebe sama a zadanou RectangleF strukturu. |
| Union(Region) |
Aktualizuje to Region na sjednocování samotného a zadaného Region. |
Union(GraphicsPath)
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
Aktualizuje to Region na sjednocování samotného a zadaného GraphicsPath.
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
Sjednocovat GraphicsPath s tímhle Region.
Výjimky
path je null.
Příklady
Příklad kódu najdete v Union(RectangleF) části a Complement(GraphicsPath) metody.
Platí pro
Union(Rectangle)
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- 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
Příklady
Příklad kódu najdete v Union(RectangleF) metodě.
Platí pro
Union(RectangleF)
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
Aktualizuje to Region na sjednocování sebe sama a zadanou RectangleF strukturu.
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 RectangleF , která se má sjednocovat s tímto Region.
Příklady
Následující příklad kódu je určený pro použití s model Windows Forms a vyžaduje PaintEventArgse. Kód provede následující akce:
Vytvoří první obdélník a nakreslí ho na obrazovku černou.
Vytvoří druhý obdélník a nakreslí ho na obrazovku červeně.
Vytvoří oblast pomocí prvního obdélníku.
Získá oblast sjednocení pro
myRegionv kombinaci scomplementRect.Vyplní oblast sjednocení modrou oblastí a nakreslí ji na obrazovku.
Všimněte si, že oba obdélníky jsou vyplněné modrou, včetně oblasti překrytí.
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
Platí pro
Union(Region)
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- Region.cs
- Zdroj:
- 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
Výjimky
region je null.
Příklady
Příklad kódu najdete v části Union(RectangleF) a Complement(GraphicsPath) metodu.