<< Click to Display Table of Contents >> Navigation: »No topics above this level« TOC : Script API > JavaScript > JavaScript API > GeneralScript > DrawingContext > Method >strokeRect |
Draws an outline of the specified rectangle.
Prototype :
void strokeRect
(
float X,
float Y,
float Width,
float Height
)
Arguments :
X |
the X-coordinate of a rectangle |
Y |
the Y-coordinate of a rectangle |
Width |
rectangle width |
Height |
rectangle height |
Reference :
Outline color and Outline thickness are defined by strokeStyle and lineWidth.
The X and Y coordinates of the shape are relative to the upper-left corner of the component.
The function draws the shape on the screen regardless of transparency or clipping of the component and it can draw the arc even in areas outside of the component. However, the shape drawn outside the input component area is clipped.
The shape drawn by the function can be exported only in pdf, jpg, png, gif, tif, svg format.
Example :
//rectangle with red outline
ctx.strokeStyle = "#FF0000";
ctx.lineWidth = 2;
ctx.strokeRect(1, 1, 100, 50);
Available Events :
OnPostDraw, OnPreDraw
See also :