網(wǎng)頁(yè)設(shè)計(jì) php繪制一個(gè)扇形的方法?
php繪制一個(gè)扇形的方法?代碼示例:<?PHP//1。Create canvas$im=imagecreatetruecolor(300200)//創(chuàng)建新的真彩色圖像。默認(rèn)背景為黑色,并返回圖像標(biāo)
php繪制一個(gè)扇形的方法?
代碼示例:
<?PHP
//1。Create canvas
$im=imagecreatetruecolor(300200)//創(chuàng)建新的真彩色圖像。默認(rèn)背景為黑色,并返回圖像標(biāo)識(shí)符。不建議使用另一個(gè)函數(shù)imagecreate。
//2. 繪制所需圖像
$red=imagecolorallocate($IM,255,0,0)//創(chuàng)建一個(gè)顏色
imagefilledarc($IM,100,80120,90,0120,$red,imgu3)。Output image
標(biāo)題(“content type:image/png”)
imagepng($IM)//輸出到頁(yè)面。如果有第二個(gè)參數(shù)[,$filename],則表示保存圖像
//4。銷(xiāo)毀圖像并釋放內(nèi)存
imagedestroy($IM)]?&燃?xì)廨啓C(jī)