Aracılığıyla paylaş


Region.Union Yöntem

Tanım

Bunu Region kendi ve belirtilen GraphicsPathbirleşimiyle Güncelleştirmeler.

Aşırı Yüklemeler

Union(GraphicsPath)

Bunu Region kendi ve belirtilen GraphicsPathbirleşimiyle Güncelleştirmeler.

Union(Rectangle)

Bunu Region kendi ve belirtilen Rectangle yapının birleşimine Güncelleştirmeler.

Union(RectangleF)

Bunu Region kendi ve belirtilen RectangleF yapının birleşimine Güncelleştirmeler.

Union(Region)

Bunu Region kendi ve belirtilen Regionbirleşimiyle Güncelleştirmeler.

Union(GraphicsPath)

Kaynak:
Region.cs
Kaynak:
Region.cs
Kaynak:
Region.cs

Bunu Region kendi ve belirtilen GraphicsPathbirleşimiyle Güncelleştirmeler.

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)

Parametreler

path
GraphicsPath

GraphicsPath ile birleşerek.Region

Özel durumlar

path, null değeridir.

Örnekler

Kod örneği için ve Complement(GraphicsPath) yöntemlerine Union(RectangleF) bakın.

Şunlara uygulanır

Union(Rectangle)

Kaynak:
Region.cs
Kaynak:
Region.cs
Kaynak:
Region.cs

Bunu Region kendi ve belirtilen Rectangle yapının birleşimine Güncelleştirmeler.

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)

Parametreler

rect
Rectangle

Bu RectangleRegionile birleşecek yapı.

Örnekler

Kod örneği için yöntemine Union(RectangleF) bakın.

Şunlara uygulanır

Union(RectangleF)

Kaynak:
Region.cs
Kaynak:
Region.cs
Kaynak:
Region.cs

Bunu Region kendi ve belirtilen RectangleF yapının birleşimine Güncelleştirmeler.

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)

Parametreler

rect
RectangleF

Bu RectangleFRegionile birleşecek yapı.

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve gerektirirPaintEventArgse. Kod aşağıdaki eylemleri gerçekleştirir:

  • İlk dikdörtgeni oluşturur ve siyah olarak ekrana çizer.

  • İkinci bir dikdörtgen oluşturur ve kırmızıyla ekrana çizer.

  • İlk dikdörtgeni kullanarak bir bölge oluşturur.

  • ile complementRectbirleştirildiğinde için myRegion birleşim alanını alır.

  • Birleşim alanını mavi ile doldurur ve ekrana çizer.

Her iki dikdörtgenin de çakışma alanı dahil olmak üzere maviyle doldurulduğuna dikkat edin.

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

Şunlara uygulanır

Union(Region)

Kaynak:
Region.cs
Kaynak:
Region.cs
Kaynak:
Region.cs

Bunu Region kendi ve belirtilen Regionbirleşimiyle Güncelleştirmeler.

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)

Parametreler

region
Region

Region ile birleşerek.Region

Özel durumlar

region, null değeridir.

Örnekler

Kod örneği için ve Complement(GraphicsPath) yöntemine Union(RectangleF) bakın.

Şunlara uygulanır