Draw a rectangle on the legend layer.

syntaxSyntax:
FWizLegend.DrawRectangle(rect, mode=FWiz.SHAPEMODE_OUTLINE, rotAngle=0, blCorner=0, brCorner=0, trCorner=0, tlCorner=0)
FWizLegend.DrawRectangle(x, y, width, height, mode=FWiz.SHAPEMODE_OUTLINE|DlxApp.RECTPOINT_CENTER, rotAngle=0, blCorner=0, brCorner=0, trCorner=0, tlCorner=0)
FWizLegend.DrawRectangle(point, width, height, mode=FWiz.SHAPEMODE_OUTLINE|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 A combination of the following values:
Value Meaning
FWiz.SHAPEMODE_OUTLINE Draw the outline of the ellipse.
FWiz.SHAPEMODE_FILLED Draw the fill of the ellipse.
To indicate the position of the point in the rectangle specify one of the following values:
DlxApp.RECTPOINT_CENTER
DlxApp.RECTPOINT_BOTTOMLEFT
DlxApp.RECTPOINT_BOTTOMRIGHT
DlxApp.RECTPOINT_TOPLEFT
DlxApp.RECTPOINT_TOPRIGHT
DlxApp.RECTPOINT_BOTTOMCENTER
DlxApp.RECTPOINT_TOPCENTER
DlxApp.RECTPOINT_MIDDLELEFT
DlxApp.RECTPOINT_MIDDLERIGHT
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.

This function can only be called in response to the OnBuildFootprint event.

Example

  Copy codeCopy code
var ctx = FWiz.GetLegendCtx();
var rect = new DlxRect(50,40,120,90);
ctx.DrawRectangle(rect, FWiz.SHAPEMODE_OUTLINE, 0, 50, 0, 0, 50);

See also