= 4.0.6, PHP 5, PHP 7, PHP 8)imageellipse — 畫(huà)一個(gè)橢圓說(shuō)明imageellipse( resource $image, int $cx, int $cy, int $width, int">

imageellipse

(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)

imageellipse畫(huà)一個(gè)橢圓

說(shuō)明

imageellipse(
    resource $image,
    int $cx,
    int $cy,
    int $width,
    int $height,
    int $color
): bool

在指定的坐標(biāo)上畫(huà)一個(gè)橢圓。

參數(shù)

image

由圖象創(chuàng)建函數(shù)(例如imagecreatetruecolor())返回的 GdImage 對(duì)象。

cx

中間的 X 坐標(biāo)。

cy

中間的 Y 坐標(biāo)。

width

橢圓的寬度。

height

橢圓的高度。

color

橢圓的顏色。顏色標(biāo)識(shí)符由 imagecolorallocate() 創(chuàng)建。

返回值

成功時(shí)返回 true, 或者在失敗時(shí)返回 false。

范例

示例 #1 imageellipse() 例子

<?php

// 新建一個(gè)空白圖像
$image imagecreatetruecolor(400300);

// 填充背景色
$bg imagecolorallocate($image000);

// 選擇橢圓的顏色
$col_ellipse imagecolorallocate($image255255255);

// 畫(huà)一個(gè)橢圓
imageellipse($image200150300200$col_ellipse);

// 輸出圖像
header("Content-type: image/png");
imagepng($image);


?>

以上例程的輸出類(lèi)似于:

例子輸出: imageellipse()

注釋

注意:

本函數(shù)需要 GD 2.0.2 或更高版本。

參見(jiàn)