Contents

strokeRect

Draws a rectangle using the current stroke color, pattern, or gradient.

Declaration

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

Parameters

  • x:

    The left edge of the rectangle, in units right from the origin of the canvas coordinate system.

  • y:

    The top of the rectangle, in units down from the origin of the canvas coordinate system.

  • width:

    The width of the rectangle, in canvas coordinate units.

  • height:

    The height of the rectangle, in canvas coordinate units.

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