fillRect method
Paints a rectangle onto a CanvasRenderingContext2D object by using the current ICanvasRenderingContext2D::fillStyle.
![]() ![]() |
Syntax
object.fillRect(x, y, w, h);
Parameters
- x [in]
-
Type: float
The x-coordinate, in pixels, of the upper-left corner of the rectangle in relation to the coordinates of the canvas.
- y [in]
-
Type: float
The y-coordinate, in pixels, of the upper-left corner of the rectangle in relation to the coordinates of the canvas.
- w [in]
-
Type: float
The width, in pixels, of the rectangle in relation to the coordinates of the canvas.
- h [in]
-
Type: float
The height, in pixels, of the rectangle in relation to the coordinates of the canvas.
Return value
This method does not return a value.
Standards information
- HTML Canvas 2D Context, Section 8
Remarks
If the w or h parameter is zero, the ICanvasRenderingContext2D::fillRect method does not draw the rectangle.
See also
Build date: 11/12/2012

