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

Exclude() public method

Updates this Region to contain only the portion of its interior that does not intersect with the specified GraphicsPath.
public Exclude ( GraphicsPath path ) : void
path System.Drawing.Drawing2D.GraphicsPath Path.
return void
        public void Exclude(GraphicsPath path)
        {
            var region = new Region(path);
            Exclude(region);
            region.Dispose();
        }

Same methods

Region::Exclude ( Rectangle rect ) : void
Region::Exclude ( RectangleF rect ) : void
Region::Exclude ( Region region ) : void

Usage Example

Beispiel #1
0
        public ScreenRegionForm(Rectangle regionRectangle, bool activateWindow = true)
        {
            InitializeComponent();

            this.activateWindow = activateWindow;

            borderRectangle = regionRectangle.Offset(1);
            borderRectangle0Based = new Rectangle(0, 0, borderRectangle.Width, borderRectangle.Height);

            Location = borderRectangle.Location;
            int windowWidth = Math.Max(borderRectangle.Width, pInfo.Width);
            Size = new Size(windowWidth, borderRectangle.Height + pInfo.Height + 1);
            pInfo.Location = new Point(0, borderRectangle.Height + 1);

            Region region = new Region(ClientRectangle);
            region.Exclude(borderRectangle0Based.Offset(-1));
            region.Exclude(new Rectangle(0, borderRectangle.Height, windowWidth, 1));
            if (borderRectangle.Width < pInfo.Width)
            {
                region.Exclude(new Rectangle(borderRectangle.Width, 0, pInfo.Width - borderRectangle.Width, borderRectangle.Height));
            }
            else if (borderRectangle.Width > pInfo.Width)
            {
                region.Exclude(new Rectangle(pInfo.Width, borderRectangle.Height + 1, borderRectangle.Width - pInfo.Width, pInfo.Height));
            }
            Region = region;

            Timer = new Stopwatch();
        }
All Usage Examples Of System.Drawing.Region::Exclude