Regions

Whereas paths define a set of figures, with both a frame and an area, a region defines only an area. A region can be used for filling or, most importantly, clipping. A region is modeled in .NET with the Region class from the System.Drawing namespace:

 sealed class Region : MarshalByRefObject, IDisposable { // Constructors public Region(...); // Methods public void Complement(...); public void Exclude(...); public static Region FromHrgn(IntPtr hrgn); public RectangleF GetBounds(Graphics g); public IntPtr GetHrgn(Graphics g); public RegionData GetRegionData(); public RectangleF[] GetRegionScans(Matrix matrix); public void Intersect(...); public bool IsEmpty(Graphics g); public bool IsInfinite(Graphics g); public bool IsVisible(...); public ...

Get Windows Forms Programming in C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.