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

  1. // create empty canvas with background color
  2. $img = Image::canvas(100, 100, '#ddd');
  3. // draw a filled blue ellipse
  4. $img->ellipse('#0000ff', 50, 50, 25, 50);
  5. // draw a non-filled red ellipse
  6. $img->ellipse('#ff0000', 50, 50, 75, 25, false);

See also