System.Drawing.Region.Union C# (CSharp) Method

Union() public method

Updates this Region to the union of itself and the specified Rectangle structure.
public Union ( Rectangle rect ) : void
rect Rectangle Rect.
return void
        public void Union(Rectangle rect)
        {
            Union ((RectangleF)rect);
        }

Same methods

Region::Union ( GraphicsPath path ) : void
Region::Union ( RectangleF rect ) : void
Region::Union ( Region region ) : void

Usage Example

Beispiel #1
0
 /// <summary>
 /// Called when the form loads
 /// </summary>
 /// <param name="sender">what triggered the event</param>
 /// <param name="e">event args</param>
 private void MainForm_Load(object sender, EventArgs e)
 {
     // make cool shape
     Region r = new Region();
     GraphicsPath gp = new GraphicsPath();
     gp.AddEllipse(new Rectangle(0, 0, this.Width, this.Height));
     r.MakeEmpty();
     r.Union(gp);
     gp = new GraphicsPath();
     gp.AddRectangle(new Rectangle(this.Width / 2, 0, this.Width / 2, this.Height / 2));
     r.Union(gp);
     this.Region = r;
 }
All Usage Examples Of System.Drawing.Region::Union