<< Click to Display Table of Contents >> Navigation: »No topics above this level« TOC : Script API > JavaScript > JavaScript API > GeneralScript > DrawingContext > Method >fillRect |
Draws a rectangle and paints the interior of it.
Prototype :
void fillRect
(
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 :
The fill color is defined in fillStyle.
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 filled with red
ctx.fillStyle = "#FF0000";
ctx.fillRect(1, 1, 100, 50);
Available Events :
OnPostDraw, OnPreDraw
See also :