Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

fillRect method

Paints a rectangle onto a CanvasRenderingContext2D object by using the current ICanvasRenderingContext2D::fillStyle.

HTML Canvas 2D Context, Section 8Internet Explorer 9

Syntax


object.fillRect(x, y, w, h);

Parameters

x [in]

Type: number

The x-coordinate, in pixels, of the upper-left corner of the rectangle in relation to the coordinates of the canvas.

y [in]

Type: number

The y-coordinate, in pixels, of the upper-left corner of the rectangle in relation to the coordinates of the canvas.

w [in]

Type: number

The width, in pixels, of the rectangle in relation to the coordinates of the canvas.

h [in]

Type: number

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

Remarks

If the w or h parameter is zero, the ICanvasRenderingContext2D::fillRect method does not draw the rectangle.

See also

ICanvasRenderingContext2D::strokeRect
ICanvasRenderingContext2D::fillStyle

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.