PHP 函数:ImageLine()

发布时间:2009年02月03日      浏览次数:929 次
ImageLine
绘实线。
语法: int imageline(int im, int x1, int y1, int x2, int y2, int col);
返回值: 整数
函数种类: 图形处理
内容说明
本函数将在图形上画出一条实线。从 x1、y1 连接到 x2、y2,原点 (0,0) 为图形的左上角。参数 col 为实线的颜色。
参考
ImageDashedLine()
--------------------------------------------------------------------------------
使用本功能需要在编译 PHP 前先安装 GD library,可到 http://www.boutell.com/gd 下载。在 1.6.2 版以前的 GD library 有支持 GIF 格式的功能,但因为 GIF 格式使用的 LZW 演算法牵涉到 Unisys 的专利权,因此在 GD library 1.6.2 版之后不支持 GIF 的格式。然而到了PHP5,GD库又支持创建GIF了。
以下是简单的例子:
<?php
Header("Content-type: image/gif");
$im = imagecreate(400,30);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
imageline($im, 1, 1, 350, 25, $black);
imagearc($im, 200, 15, 20, 20, 35, 190, $white);
imagestring($im, 5, 4, 10, "Graph TEST!!", $white);
ImageGif($im);
ImageDestroy($im);
?>
免责声明:本站相关技术文章信息部分来自网络,目的主要是传播更多信息,如果您认为本站的某些信息侵犯了您的版权,请与我们联系,我们会即时妥善的处理,谢谢合作!