imagefilledellipse
Description
The imagefilledellipse of Image for PHP draw a filled ellipse.
Syntax
imagefilledellipse( 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 fill color. 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 = imagefilledellipse($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; imagefilledellipse($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/gAIDAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABoUlEQVR4nO3dy0oDURQFUdv//+c42BACCUjF87hqraGTDsXuJqD2vT5Ocrvdnn94Xdf8J3nplM/xMtOjE5Ltf4JvMz3aTbYcC5WKxV6bsd4oFVu91mK9XSpWeu3E+mGpmO+1EKukVAz3mo5VWCome43GKi8VY73mYjWViplenwPX+DOGltU6qxgY10SsgVLR3cvbEGhf1tisonVcLgvoXdbwrKJvXC4LMBbQeBuu3IPRdCe6LKBrWYuzio5xuSzAWEDLbbh+D0b5neiyAGMBxgLqn1mHPLCi9rHlsgBjAcYCjAUUP+CPerpH4TPeZQHGAowFGAswFmAsoPKrw4HfG6Lq24PLAowFGAswFmAswFiAsQBjAcYCjAUYCzAWYCzAWICxAGMBxgKMBfgbacBlAcYCjAUYCzAWYCzAv1YGXBZgLMBYgLEA/4UOcFmAsQBjAf73PeCyAGMBvl4FcFmA788CXBZgLMAXJAIuC/ClroDLAny3MrlE9wXufMX5/+JJA+RCM5e58wwLxtNRGM/dYTzRifGsMMZT6BjPN8R+xcmZX2E7eKHteJNJAAAAAElFTkSuQmCC"> </body> </html>
Links
Image
- gd_info
- getimagesize
- getimagesizefromstring
- image_type_to_extension
- image_type_to_mime_type
- imageaffine
- imageaffinematrixconcat
- imageaffinematrixget
- imagealphablending
- imageantialias
- imagearc
- imageavif
- imagebmp
- imagechar
- imagecharup
- imagecolorallocate
- imagecolorallocatealpha
- imagecolorat
- imagecolorclosest
- imagecolorclosestalpha
- imagecolorclosesthwb
- imagecolordeallocate
- imagecolorexact
- imagecolorexactalpha
- imagecolormatch
- imagecolorresolve
- imagecolorresolvealpha
- imagecolorset
- imagecolorsforindex
- imagecolorstotal
- imagecolortransparent
- imageconvolution
- imagecopy
- imagecopymerge
- imagecopymergegray
- imagecopyresampled
- imagecopyresized
- imagecreate
- imagecreatefromavif
- imagecreatefrombmp
- imagecreatefromgif
- imagecreatefromjpeg
- imagecreatefrompng
- imagecreatefromstring
- imagecreatefromtga
- imagecreatefromwbmp
- imagecreatefromwebp
- imagecreatefromxbm
- imagecreatefromxpm
- imagecreatetruecolor
- imagecrop
- imagecropauto
- imagedashedline
- imagedestroy
- imageellipse
- imagefill
- imagefilledarc
- imagefilledpolygon
- imagefilledrectangle
- imagefilltoborder
- imagefilter
- imageflip
- imagefontheight
- imagefontwidth
- imageftbbox
- imagefttext
- imagegammacorrect
- imagegetclip
- imagegetinterpolation
- imagegif
- imageinterlace
- imageistruecolor
- imagejpeg
- imagelayereffect
- imageline
- imageloadfont
- imageopenpolygon
- imagepalettecopy
- imagepalettetotruecolor
- imagepng
- imagepolygon
- imagerectangle
- imageresolution
- imagerotate
- imagesavealpha
- imagescale
- imagesetbrush
- imagesetclip
- imagesetinterpolation
- imagesetpixel
- imagesetstyle
- imagesetthickness
- imagesettile
- imagestring
- imagestringup
- imagesx
- imagesy
- imagetruecolortopalette
- imagettfbbox
- imagettftext
- imagetypes
- imagewbmp
- imagewebp
- imagexbm
- iptcembed
- iptcparse