Rectangle

Creates a rectangle.

Parameters
width

Width of rectangle in pixels.

height

Height in pixels.

pos

Array of X and Y position. X is the distance in pixels from the left of the canvass to the left of the rectangle. Y is the distance from the top of the canvass to the top of the rectangle. Defaults to array(0,0).

borderSize

Size of the border in pixels. Defaults to 1 pixel. Set to 0 for no border.

borderColor

Border color. Defaults to black. Set to null for no color.

fillColor

Fill color. Defaults to white. Set to null for no color.

Examples
//...

$editor->draw( $image, Grafika::createDrawingObject('Rectangle', 85, 50)); // A 85x50 no filled rectangle with a black 1px border on location 0,0.
$editor->draw( $image, Grafika::createDrawingObject('Rectangle', 85, 50, array(105, 10), 0, null, new Color('#FF0000'))); // A 85x50 red rectangle with no border.
$editor->draw( $image, Grafika::createDrawingObject('Rectangle', 85, 50, array(105, 70), 0, null, new Color('#00FF00'))); // A 85x50 green rectangle with no border.
$editor->draw( $image, Grafika::createDrawingObject('Rectangle', 85, 50, array(0, 60), 1, '#000000', null)); // No fill rectangle

The result of the above code:

testRectangle