【php开源代码栏目提醒】:网学会员为广大网友收集整理了,9_21.php,希望对大家有所帮助!
<?php
//新建一个真彩色图形
$image=imagecreatetruecolor(200,200);
//设置背景颜色
$back = imagecolorallocate($image, 255, 255, 255);
imagefill($image,0,0,$back);
// 用 alpha 值分配一些颜色
$yellow = imagecolorallocatealpha($image, 255, 255, 0, 75);
$red = imagecolorallocatealpha($image, 255, 0, 0, 75);
$blue = imagecolorallocatealpha($image, 0, 0, 255, 75);
// 画三个交迭的圆
imagefilledellipse($image, 60,50, 100,100, $yellow);
imagefilledellipse($image, 70,80, 100,100, $red);
imagefilledellipse($image, 90,60, 100,100, $blue);
//输出头文件信息
header('Content-type: image/png');
//输出PNG图形
imagepng($image);
//释放资源
imagedestroy($image);
?>