Draws a rectangle. Returns an instance of the Shape object which corresponds to the drawn shape, or the shape in which the rectangle has been drawn.
Applies to: Page object, Shape object
[[Set] shapeRet =] object.DrawRect ( xLeft, yTop, xRight, yBottom ) |
The DrawRect method syntax has these parts:
Part | Description |
object | Required. An expression that returns an instance of an object from the Applies to list. |
xLeft | Required. An expression that returns a Double value. It represents the X-coordinate of the top left corner of the rectangle. |
yTop | Required. An expression that returns a Double value. It represents the Y-coordinate of the top left corner of the rectangle. |
xRight | Required. An expression that returns a Double value. It represents the X-coordinate of the bottom right corner of the rectangle. |
yBottom | Required. An expression that returns a Double value. It represents the Y-coordinate of the bottom right corner of the rectangle. |
shapeRet | Optional. A Shape type variable. |
If object is a page or a group, the DrawRect method creates on that page or group a shape containing a geometry that describes the rectangle with the specified size and coordinates. Then in returns an instance of the Shape object, that corresponds to the created shape. If the DrawRect method was called after the BeginShape method, it adds a geometry describing the rectangle to the current Basic shape. Then it returns an instance of the Shape object, that corresponds to the current Basic shape of the page or group.
If object is a simple shape, the DrawRect method draws the rectangle in this shape and returns object.
When using the DrawRect method, the order in which the coordinates are specified is not significant. The coordinates of the points are specified in the coordinate system of the shape, group or page to which the instance of object corresponds. The coordinates are measured in the internal units (InternalUnit).
See Also |
BeginShape method, DrawLine method, DrawOval method, DrawSector method, EndShape method |