/**绘制各种图形*///1.创建资源画布的大小$img=p_w_picpathcreatetruecolor(200,200);$white=p_w_picpathcolorallocate($img,0xFF,0xFF,0xFF);$red=p_w_picpathcolorallocate($img,255,0,0);$blue=p_w_picpathcolorallocate($img,0,0,0xFF);$pink=p_w_picpathcolorallocate($img,0xFF,0,0xFF);p_w_picpathfill($img,0,0,$white);//2.制作各种颜色p_w_picpathline($img,0,0,200,200,$blue);p_w_picpathline($img,200,0,0,200,$red);//3.画出各种图形和写字//画矩形p_w_picpathrectangle($img,50,50,150,150,$pink);p_w_picpathfilledrectangle($img,75,75,125,125,$blue);//画圆p_w_picpathellipse($img,50,50,50,50,$pink);p_w_picpathfilledellipse($img,150,150,50,50,$pink);//画圆弧p_w_picpatharc($img,150,50,75,75,0,90,$blue);//画一个字符串p_w_picpathstring($img,5,50,100,'myweb',$red);p_w_picpathstring($img,6,10,10,'myenglish',$red);p_w_picpathttftext($img,10,0,70,180,$blue,'./fonts/simhei.ttf','津沙港湾');//指定字体//4.保存或输出给浏览器写第二个参数就是保存//header("Content-Type:p_w_picpaths/png");header('Content-type:p_w_picpath/jpeg');p_w_picpathpng($img);//5.释放资源p_w_picpathdestroy($img);

结果为