Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

imageellipse

Description

The imageellipse of Image for PHP draw an ellipse.

Syntax

imageellipse(
    GdImage $image,
    int $center_x,
    int $center_y,
    int $width,
    int $height,
    int $color
): bool

Parameters

image

A GdImage object, returned by one of the image creation functions, such as imagecreatetruecolor().

center_x

x-coordinate of the center.

center_y

y-coordinate of the center.

width

The ellipse width.

height

The ellipse height.

color

The color of the ellipse. A color identifier created with imagecolorallocate().

Return

Returns true on success or false on failure.

Examples

1 · return

<?

$width = 100;
$height = 100;
$image = imagecreate($width, $height);

$red = 255;
$green = 255;
$blue = 255;
$color = imagecolorallocate($image, $red, $green, $blue);

$center_x = 0;
$center_y = 0;
$width = 50;
$height = 100;

$return = imageellipse($image, $center_x, $center_y, $width, $height, $color);
    
var_export($return);

?>
true

2 · base64

<?

$width = 100;
$height = 100;
$image = imagecreatetruecolor($width, $height);

$red = 255;
$green = 255;
$blue = 255;
$color = imagecolorallocate($image, $red, $green, $blue);

$center_x = 50;
$center_y = 50;
$width = 50;
$height = 100;
imageellipse($image, $center_x, $center_y, $width, $height, $color);

ob_start();

    imagepng($image);

$output = ob_get_clean();

echo '<!doctype html>
<html>
<body>
    <img src="data:image/png;base64,' . base64_encode($output) . '">
</body>
</html>';

?>
<!doctype html>
<html>
<body>
    <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABaUlEQVR4nO3dwU7DMBQF0ab//89mkSVVxVA/v1t7zrIgOR6cKAUaX48kY4zfL17Xtf5Ioo0xXpZ6/6Xj/LGFyV6fdxO/fx//m/mJvT6Z81m9Pp/tKb1mzXP/XnNnuHOvirnt2atuVst6PdcMI6D6h7/PybhmJgtG8TRMsvIEqR7LlRVj/XW3dERXFmCsDF33PnXjurIC9N5SF43uygKM1S3hbW3FMbiyAGMBxmqVcMG6TT8SVxZgLMBYgLH65Fzdb3OPx5UFGAswFmAswFiAsZqk3TfcJh6VKwswFmAswFiAsQBjAcYCjAUYCzAWYCzAWICxAGMBxgKMBRgLMFaftN8s+xfpNsYCjAUYCzAWYKxWOXcP/rdyJ2MBxgKM1S3hGu9H6JoZCzBWAD99fzpjZfDxKirj87POZawkPiBRZXyoq8r4bGXGR5yrjDsNMO5hwbg7CuO+O4w7OjHuFca4Cx3j/obYV+yc+QNfGASHyvZfWQAAAABJRU5ErkJggg==">
</body>
</html>
HomeMenu