This topic has not yet been rated - Rate this topic

rect method

Creates a new closed rectangular subpath.

HTML Canvas 2D Context, Section 9Internet Explorer 9

Syntax


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

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.

Standards information

Remarks

The ICanvasRenderingContext2D::rect method creates a closed path for the rectangle and then starts a new subpath at the point (x, y). You can fill the rectangle by using the ICanvasRenderingContext2D::fillStyle property and the ICanvasRenderingContext2D::fill method.

 

 

Build date: 11/12/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.