GDI Plus Rectangle Foundation Class
The gpRectangle class encapsulates a set of four numbers that represent the location and size of a rectangle.
Category |
Reporting |
---|---|
Default Catalog |
Visual FoxPro Catalog\Foundation Classes\Output\GDIplus |
Class |
gpRectangle |
Base Class |
Custom |
Class Library |
_GDIPLUS.vcx |
Parent Class |
gpBase (GDI Plus Base Foundation Class) |
Remarks
The following table lists public properties and methods added by this class to its parent class, gpBase. This class also implements the Clone and Init methods.
Properties and methods |
Description |
---|---|
Clone Method |
Clones a rectangle object. Syntax: ? THIS.Clone(toGpRectangle) Return Values: Logical, representing success or failure. Parameters: toGpRectangle, required, the gpRectangle-based object to clone. |
Create Method |
Creates a rectangle object from specified coordinates. Syntax: THIS.Create(tX,tY, tW, tH) Return Values: Logical, representing success or failure. Parameters: tX, required, the X coordinate for the rectangle to create. tY, required, the Y coordinate for the rectangle to create. tW, required, the width for the rectangle to create. tH, required, the height for the rectangle to create. |
CreateFromPointSize Method |
Creates a rectangle from a gpPoint object and a gpSize object. Syntax: THIS.CreateFromPointSize(toPoint,toSize) Return Values: Logical, representing success or failure. Parameters: toPoint, required, a point object representing the starting point of the rectangle to create. toSize, required, a size object representing the width and height of the rectangle to create. |
GdipPoint Property |
String representing a GDI+ Point structure (composed of two 32-bit integers), providing the starting point of the rectangle. Default: Empty. |
GdipPointF Property |
String representing a GDI+ PointF structure (composed of two 32-bit single-precision float values), providing the starting point of the rectangle. Default: Empty. |
GdipRect Property |
String representing a GDI+ Rect structure (composed of four 32-bit integers), providing the starting point of the rectangle. Default: Empty. |
GdipRectF Property |
String representing a GDI+ RectF structure (composed of four 32-bit single-precision float values), providing the starting point of the rectangle. Default: Empty. |
gdiRect Property |
String representing the Win32 "RECT" structure (as values X, Y, X2, Y2). Remarks: This property is useful when working with Windows GDI functions, which expect rectangles defined as the coordinates of two diagonally-opposite corners, rather than top, left, width and height values. Default: Empty. |
gpPoint Property |
Starting or origin point of the rectangle represented as a gpPoint object. Default: Empty. |
gpSize Property |
Width and Height of the rectangle as a gpSize object. Default: Empty. |
H Property |
Height of the rectangle. Default: 0. |
Init Method |
Constructs a rectangle object during initialization if passed appropriate arguments. Syntax: CREATEOBJECT("gpRectangle" [,tX_Rect_Point,tY_Size, tW, tH]) Return Values: Logical, representing success or failure. If the method fails, the object does not instantiate. Parameters: tX_Rect_Point, required if immediate creation of the object is requested, represents the X coordinate for the starting point of the rectangle, an existing gpRectangle-based object to be cloned, or a top-left point for the rectangle. tY_Size, required if immediate creation of the object is requested and tX_Rect_Point is not an object of type gpRectangle, represents the Y coordinate for the starting point of the rectangle, if tX_Rect_Point was the point's X coordinate, or an object of type gpSize, if tX_Rec_Point was an object of type gpPoint. tW, required if the first two parameters were coordinates, represents the width of the rectangle to create. tH, required if the first two parameters were coordinates, represents the height of the rectangle to create. |
Set Method |
Sets a rectangle's coordinates from individual components. Syntax: THIS.Set(tX, tY, tW, tH) Return Values: Logical, representing success or failure. Parameters: tX, required, the X coordinate of the starting point of the rectangle to be set. tY, required, the Y coordinate of the starting point of the rectangle to be set. tW, required, the width of the rectangle to be set. tH, required, the height of the rectangle to be set. |
W Property |
Width of the rectangle. Default: 0. |
X Property |
X-coordinate of the starting point (top-left) of the rectangle. Default: 0. |
X2 Property |
X-coordinate of the ending point (bottom-right) of the rectangle. Default: 0. |
Y Property |
Y-coordinate of the starting point (top-left) of the rectangle. Default: 0. |
Y2 Property |
Y-coordinate of the ending point (bottom-right) of the rectangle. Default: 0. |
See Also
Concepts
Guidelines for Using Visual FoxPro Foundation Classes