Contents

fillRect

Fills a specified rectangle in the current fill color, gradient, or pattern.

Declaration

void fillRect(
    unrestricted float x, 
    unrestricted float y, 
    unrestricted float width, 
    unrestricted float height
);

Parameters

  • x:

    The x-coordinate of the left edge of the rectangle, in pixels from the left edge of the canvas coordinate system.

  • y:

    The y-coordinate of the top edge of the rectangle, in pixels from the top of the canvas coordinate system.

  • width:

    The width of the rectangle, in pixels.

  • height:

    The height of the rectangle, in pixels.

Discussion

All parameter values are in the canvas’s current coordinate system, subject to the current transformation matrix (rotation, scale, and so on).

See Also

Drawing Rectangles