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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.