热门关键字: jsp web pl/sql pl webwor   →开发工具  操作系统
当前位置 : 无忧IT编程网 > 其它语言 > PHP > 正文

PHP图像函数使用方法实例

来源:转载作者:无忧时间:08-01-24

    下面是一个介绍PHP图像函数使用方法的实例

<?php
//建立图像
$height = 200;
$width =200;
$im = imagecreate($width,$height);
$white = imagecolorallocate($im,255,255,255);
$black1 = imagecolorallocate($im,0,0,0);
$black = imagecolorallocate($im,255,255,255);

//在图上绘画
imagefill($im,0,0,$black1);
imageline($im,0,0,$width,$height,$white);
imagestring($im,4,50,150,"Sales",$white);

//输出图像
header("Content-type: image/png");
imagepng($im);

//清理
imagedestroy($im);
?> 


 

最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 验证码: 验证码
查看所有评论
相关文章
站长推荐