Creates a rectangle.
Syntax: |
---|
FWizAssembly.DrawRectangle(rect, rotAngle=0, blCorner=0, brCorner=0, trCorner=0, tlCorner=0) FWizAssembly.DrawRectangle(x, y, width, height, mode=DlxApp.RECTPOINT_CENTER, rotAngle=0, blCorner=0, brCorner=0, trCorner=0, tlCorner=0) FWizAssembly.DrawRectangle(point, width, height, mode=DlxApp.RECTPOINT_CENTER, rotAngle=0, blCorner=0, brCorner=0, trCorner=0, tlCorner=0) |
Parameters
Parameter | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
rect | A DlxRect object that specify the rectangle to be drawn. | |||||||||
x | Horizontal position of a point in the rectangle. The position of the point in the rectangle is specified in the mode parameter. | |||||||||
y | Vertical position of a point in the rectangle. The position of the point in the rectangle is specified in the mode parameter. | |||||||||
width | A positive value that defines the width of the rectangle. | |||||||||
height | A positive value that defines the height of the rectangle. | |||||||||
point | A DlxPoint object that specifies a point in the rectangle. The position of the point in the rectangle is specified in the mode parameter. | |||||||||
mode | To indicate the position of the point in the rectangle specify one of the following values:
|
|||||||||
rotAngle | The angle, in degrees, of rotation of the rectangle with respect to the x-axis. | |||||||||
blCorner | Specify the shape of the bottom left corner. | |||||||||
brCorner | Specify the shape of the bottom right corner. | |||||||||
trCorner | Specify the shape of the top right corner. | |||||||||
tlCorner | Specify the shape of the top left corner. |
Return Value
If an error occurs it returns false otherwise it returns true.
Remarks
You can draw a rectangle or square with rounded or beveled corners. The rounding produces a curved corner, the bevel replaces the corner with a straight edge.
To draw rectangles or squares with rounded or blunted corners, you must specify the size of the angle. To round an angle, the angle dimensions determine the radius of the angle. The radius is measured from the center of the curve to its perimeter. Higher values produce more rounded or blunted corners. The size value for beveling an angle represents the distance for setting the starting point of the bevel to the original angle. Higher values produce a longer beveled edge.
The dimensions of the angle should be indicated as a percentage. Enter values between -100 and +100. The value of 0% indicates that the corners of the rectangle are at 90°. Negative values produce a blunt edge while positive values produce a rounded edge.
Example
Copy code | |
---|---|
function OnBuildAssembly()
{
var ctx = FWiz.GetAssemblyCtx();
var pen = FWiz.GetPenStyle(0);
pen.SetStyle("Marker pen blue");
ctx.SetPenStyle(pen);
var brush = FWiz.GetBrushStyle(0);
brush.SetStyle("Yellow");
ctx.SetBrushStyle(brush);
var rect = new DlxRect(-50,-30,50,30);
ctx.DrawRectangle(rect, 0, 50, 0, 0, 50);
}
|