strokeRect method

[This documentation is preliminary and is subject to change.]

Creates an outline of the specified rectangle on a canvas by using the current stroke, line width, and join styles.

HTML Canvas 2D Context, Section 8Internet Explorer 9

Syntax

HRESULT retVal = object.strokeRect(x, y, w, h);

Standards information

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

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The strokeRect method creates a path that requires the use of the stroke method to render the rectangle. The outline uses the current strokeStyle, lineWidth, lineJoin, and, when appropriate, miterLimit properties. If the w or h parameter is zero, a line is drawn. If the w and h parameters are zero, the rectangle is not drawn.

 

 

Build date: 1/23/2012