PHP 中的 imagefilledellipse() 函式
imagefilledellipse() 函式用於繪製一個填充的橢圓。
語法
imagefilledellipse( $img, $cx, $cy, $width, $height, $color )
引數
img 使用 imagecreatetruecolor() 建立一個空白影像
cx 圓心的 x 座標。
cy 圓心的 y 座標。
width 橢圓寬度。
height 橢圓高度。
color 填充顏色。
返回
imagefilledellipse() 函式在成功時返回 TRUE,失敗時返回 FALSE。
示例
以下是一個示例
<?php
$img = imagecreatetruecolor(450, 290);
$bgColor = imagecolorallocate($img, 140, 180, 140);
imagefill($img, 0, 0, $bgColor);
$ellipse = imagecolorallocate($img, 120, 50, 70);
imagefilledellipse($img, 225, 150, 400, 250, $ellipse);
header("Content-type: image/png");
imagepng($img);
?>輸
以下是輸出

Advertisement 廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP