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.
![]() ![]() |
Syntax
HRESULT retVal = object.strokeRect(x, y, w, h);
Standards information
- HTML Canvas 2D Context, Section 8
Parameters
x [in]
Type: floatThe x-coordinate, in pixels, of the upper-left corner of the rectangle in relation to the coordinates of the canvas.
y [in]
Type: floatThe y-coordinate, in pixels, of the upper-left corner of the rectangle in relation to the coordinates of the canvas.
w [in]
Type: floatThe width, in pixels, of the rectangle in relation to the coordinates of the canvas.
h [in]
Type: floatThe 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
.png)
.png)