이미지 타원() 타원을 그리는 데 사용되는 PHP의 내장 함수입니다. 성공하면 True, 실패하면 False를 반환합니다.
구문
Bool imageellipse($image, $cx, $cy, $width, $height, $color)
매개변수
이미지 타원() 6개의 다른 매개변수를 사용합니다. $image , $cx , $cy , $너비 , $높이 , $color .
-
$이미지 - 이미지의 크기를 생성합니다. imagecreatetruecolor()와 같은 이미지 생성 함수 중 하나에서 반환됩니다.
-
$cx − 중심의 x 좌표를 설정합니다.
-
$cy − 중심의 y 좌표를 설정합니다.
-
$너비 − 타원 너비를 설정합니다.
-
$높이 − 타원 높이를 설정합니다.
-
$color − 타원의 색상을 설정합니다. imagecolorallocate() 함수에 의해 생성된 색상 식별자입니다.
반환 값
성공하면 True, 실패하면 False를 반환합니다.
예시 1
<?php
// Create a blank image.
$image = imagecreatetruecolor(700, 350);
// Select the background color.
$bg = imagecolorallocate($image, 0, 0, 0);
// Fill the background with the color selected above.
imagefill($image, 0, 0, $bg);
// Choose a color for the ellipse.
$col_ellipse = imagecolorallocate($image, 255, 255, 255);
// Draw the ellipse.
imageellipse($image, 325, 175, 500, 175, $col_ellipse);
// Output the image.
header("Content-type: image/png");
imagepng($image);
?> 출력

예시 2
<?php
//It creates the blank image or size of the image.
$image = imagecreatetruecolor(700, 600);
//Set the background color of the image.
$bg = imagecolorallocate($image, 122, 122, 122);
//Fill background with the above-selected color.
imagefill($image, 0, 0, $bg);
// set color of the ellipse.
$col_ellipse = imagecolorallocate($image, 0, 255, 255);
// Function to draw the ellipse.
imageellipse($image, 250, 300, 300, 550, $col_ellipse);
// Output of the image.
header("Content-type: image/gif");
imagepng($image);
?> 출력
