이미지 처리 및 GD imagefilledellipse
(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)
imagefilledellipse — 채워진 타원 그리기
설명
imagefilledellipse( GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color ): bool
주어진 image
의 지정된 좌표를 중심으로 타원을 그립니다.
매개변수
image
- imagecreatetruecolor()와 같은 이미지 생성 함수 중 하나에서 반환되는 GdImage 객체.
center_x
- 중심의 x 좌표.
center_y
- 중심의 y 좌표.
width
- 타원 너비입니다.
height
- 타원 높이.
color
- 채우기 색상입니다. imagecolorallocate()로 생성된 색상 식별자입니다.
반환 값
성공하면 true
를, 실패하면 false
를 반환합니다.
변경 로그
버전 | 설명 |
---|---|
8.0.0 | image 는 이제 GdImage 인스턴스를 예상합니다. 이전에는 리소스가 필요했습니다. |
Examples
예제 #1 imagefilledellipse() 예제
<?php
// create a blank image
$image = imagecreatetruecolor(400, 300);
// fill the background color
$bg = imagecolorallocate($image, 0, 0, 0);
// choose a color for the ellipse
$col_ellipse = imagecolorallocate($image, 255, 255, 255);
// draw the white ellipse
imagefilledellipse($image, 200, 150, 300, 200, $col_ellipse);
// output the picture
header("Content-type: image/png");
imagepng($image);
?>
위의 예는 다음과 유사한 결과를 출력합니다.
메모
메모: imagefilledellipse()는 imagesetthickness()를 무시합니다.
기타
- imageellipse() - 타원을 그립니다.
- imagefilledarc() - 부분 호를 그리고 채우기