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:

 NotInheritable Class Region ' Constructors Public Sub New(...) ' Methods Sub Complement(...) Sub Exclude(...) Shared Function FromHrgn(hrgn As IntPtr) As Region Function GetBounds(g As Graphics) As RectangleF Function GetHrgn(g As Graphics) As IntPtr Function GetRegionData() As RegionData Function GetRegionScans(matrix As Matrix) As RectangleF() Sub Intersect(...) Function IsEmpty(g As Graphics) As Boolean Function IsInfinite(g As Graphics) As Boolean Function IsVisible(...) As Boolean Sub ...

Get Windows Forms Programming in Visual Basic .NET 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.