网络编程 
首页 > 网络编程 > 浏览文章

php画图实例

(编辑:jimmy 日期: 2024/10/14 浏览:3 次 )

本文实例讲述了php画图的方法。分享给大家供大家参考。具体实现方法如下:

复制代码 代码如下:<"c:\\WINDOWS\\Fonts\\simhei.ttf";  
//生成大雪花 其实就是调用imagettftext()输出*号 
for ($i=1; $i<=400; $i++)  

    $font_color = imagecolorallocate($img, mt_rand(100,200), mt_rand(100,200), mt_rand(100,200)); 
    imagettftext($img, $snowflake_size, mt_rand(0, 180), mt_rand(0, $imgWidth),mt_rand(0, $imgHeight), $font_color, $font_file, "□");  

//水印文字 
$black_color = imagecolorallocate($img, 0, 0, 0); 
imagettftext($img, 12, 0, $imgWidth - 50 , $imgHeight - 20, $black_color, $font_file, "PHP画图"); 
imagepng($img); 
imagedestroy($img); 
"//img.jbzj.com/file_images/article/201411/2014115155925003.gif" alt="" />

更多请参考:
http://www.php.net/manual/zh/refs.utilspec.image.php

希望本文所述对大家的PHP程序设计有所帮助。

上一篇:PHP动态编译出现Cannot find autoconf的解决方法
下一篇:PHP队列用法实例