Fork me on GitHub

ellipse — Draw an ellipse

Description

public Intervention\Image\Image ellipse(mixed $color, int $pos_x, int $pos_y, [int $width, [int $height, [boolean $filled]]])

Draw a colored ellipse at given x, y, coordinates. You can define width and height and whether the ellipse should be filled or not.

Parameters

color

The color of the ellipse. Pass a color in one of the different color formats.

pos_x

x-coordinate of the center.

pos_y

y-coordinate of the center.

width (optional)

width of the ellipse. Default: 10

height (optional)

The ellipse height. Default: 10

filled (optional)

Whether to fill the ellipse or not. Default: true

Return Values

Instance of Intervention\Image\Image

Examples

// create empty canvas with background color
$img = Image::canvas(100, 100, '#ddd');

// draw a filled blue ellipse
$img->ellipse('#0000ff', 50, 50, 25, 50);

// draw a non-filled red ellipse
$img->ellipse('#ff0000', 50, 50, 75, 25, false);

See also