image.drawRect()

edit

Draws a rectangle.

image.drawRect( x=number, y=number, width=number, height=number, filled=boolean )

Returns: Image

Argument Description
x
number, required
edit

The x coordinate of the rectangle.

y
number, required
edit

The y coordinate of the rectangle.

width
number, required
edit

The width of the rectangle.

height
number, required
edit

The height of the rectangle.

filled
boolean, optional
edit

Specify whether the rectangle is filled:

  • true: The rectangle is filled with the specified drawing color.
  • false (default): Only the outline of the rectangle is drawn.

Examples

edit
	img=imageNew("",200,200,"RGB","00fcfc");
	img.DrawRect(45,50,75,125);
	img.DrawRect(70,50,75,10);
	cfimage(action="writeToBrowser",source=img);

See also