close
說明
bool imageellipse ( resource $image , int $cx , int $cy , int $width , int $height , int $color )
參數
image
由圖象創建函數(例如imagecreatetruecolor())返回的圖象資源。
cx
中間的 X 坐標。
cy
中間的 Y 坐標。
width
橢圓的寬度。
height
橢圓的高度。
color
橢圓的顏色。顏色標識符由 imagecolorallocate() 創建。
<?php
// 新建一個空白圖像
$image = imagecreatetruecolor(400, 300);
// 填充背景色
$bg = imagecolorallocate($image, 0, 0, 0);
// 選擇橢圓的顏色
$col_ellipse = imagecolorallocate($image, 255, 255, 255);
// 畫一個橢圓
imageellipse($image, 200, 150, 300, 200, $col_ellipse);
// 輸出圖像
header("Content-type: image/png");
imagepng($image);
?>
全站熱搜