VB.NET 1.1 Tutorial - GDI+ - Rectangle and RectangleFRectangleA Rectangle structure stores a set of four integers that represent the location and size of a rectangle. A rectangle is defined by its width, height, and upper-left corner. By default, GDI+ will interpret the values entered as the amount of pixels on the screen. There a two methods of creating a new Rectangle object. Public Sub New( _ ByVal location As Point, _ ByVal size As Size _ ) This method initializes a new instance of the Rectangle class with the specified location and size.
Public Sub New( _ ByVal x As Integer, _ ByVal y As Integer, _ ByVal width As Integer, _ ByVal height As Integer _ ) This method initializes a new instance of the Rectangle class with the specified location and size.
RectangleFA RectangleF structure is only different to a Rectangle structure in the fact that floating point values are used instead of integers. The two methods of creating a new RectangleF object are defined as: Public Sub New( _ ByVal location As PointF, _ ByVal size As SizeF _ ) and Public Sub New( _ ByVal x As Single, _ ByVal y As Single, _ ByVal width As Single, _ ByVal height As Single _ ) ReferencesFor more information on the Rectangle structure, visit MSDN at microsoft here. For more information on the RectangleF structure, visit MSDN at microsoft here. What Next?Return to the Tutorial Contents. |