imageellipse

imageellipse

簡介,函式說明,使用範例,

簡介

(PHP 4 >= 4.0.6, PHP 5)imageellipse -- 畫一個橢圓

函式說明

bool imageellipse ( resource image, int cx, int cy, int w, int h, int color )
imageellipse() 在 image 所代表的圖像中畫一個中心為 cx,cy(圖像左上角為 0, 0)的橢圓。w 和 h 分別指定了橢圓的寬度和高度,橢圓的顏色由 color 指定。

使用範例

例子 1. imageellipse()例子
<?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);
?>

相關詞條

熱門詞條

聯絡我們