Canvas.drawRect

Syntax

drawRect(x: Number, y: Number, width: Number, height: Number, drawFill: Boolean, drawStroke: Boolean);

Parameters

cx. X coordinate of the top left rectangle corner.

cy. Y coordinate of the top left rectangle corner.

width. Rectangle width.

height. Rectangle height.

drawFill. It determines whether rectangle is filled. If the parameter is set to True, rectangle is filled.

drawStroke. It determines whether rectangle borders are rendered. If the parameter is set to True, borders are rendered.

Description

The drawRect method draws a rectangle on the canvas.

Comments

The rectangle is displayed on the canvas after calling the Canvas.flush method.

Example

The example of method use is given on the Example of Creating the Canvas Component page.

See also:

Canvas