欢迎光临
感谢一路有你

案例-GD库画国旗

如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
 

源码如下:

<?php
header("content-type:text/html;charset=utf-8");

$img = imagecreatetruecolor(464,310);

$red = imagecolorallocate($img,222,41,16);
$yellow = imagecolorallocate($img,255,222,0);

imagefill($img,0,0,$red);


$arr = array(35,63,69,63,79,35,90,63,123,63,97,84,105,118,78,99,52,116,59,84);
$arr1 = array(144,22,156,24,161,18,161,28,171,32,160,37,160,46,152,38,141,39,148,31);
$arr2 = array(171,65,182,59,180,50,188,57,196,52,194,62,201,70,192,70,185,78,183,67);
$arr3 = array(172,104,184,104,187,94,190,104,202,104,194,111,199,124,188,113,178,124,181,111);
$arr4 = array(144,130,155,133,161,127,160,136,171,142,160,145,160,154,152,145,143,149,150,138);

imagepolygon($img,$arr,10,$yellow);
imagefilledpolygon($img,$arr,10,$yellow);
imagepolygon($img,$arr1,10,$yellow);
imagefilledpolygon($img,$arr1,10,$yellow);
imagepolygon($img,$arr2,10,$yellow);
imagefilledpolygon($img,$arr2,10,$yellow);
imagepolygon($img,$arr3,10,$yellow);
imagefilledpolygon($img,$arr3,10,$yellow);
imagepolygon($img,$arr4,10,$yellow);
imagefilledpolygon($img,$arr4,10,$yellow);

header("content-type:image/jpeg");
imagejpeg($img);

imagedestroy($img);

 

赞(1) 打赏
未经允许不得转载:王明昌博客 » 案例-GD库画国旗
分享到: 更多 (0)

相关推荐

  • 暂无文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

×
订阅图标按钮