O'Reilly logo

Windows Forms Programming in C# by Chris Sells

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required