日期:2014-05-17 浏览次数:20423 次
$img = imagecreatetruecolor(600, 600); $white = imagecolorallocate($img, 255, 255, 255); imagedashedline($img, 20, 20, 500, 20, $white); imagedashedline($img, 20, 20, 20, 500, $white); header("content-type:image/jpeg"); imagejpeg($img); imagedestroy($img);
$img = imagecreatetruecolor(600, 600); $white = imagecolorallocate($img, 255, 255, 255); $red = imagecolorallocate($img, 255, 0, 0); $style = array($red, $red, $red, $red, $red, $white, $white, $white, $white, $white); imagesetstyle($img, $style); imageline($img, 20, 20, 500, 20, IMG_COLOR_STYLED); header("content-type:image/jpeg"); imagejpeg($img); imagedestroy($img);
------解决方案--------------------
The bug reported by 'michi at marel dot at' also exists in PHP version 5.1.1. This functions just works with vertical lines! 5.1.1版本发现的BUG,反对使用本函数。应该用 imagesetstyle() 和 imageline() 的组合替代之
------解决方案--------------------
This functions just works with vertical lines!该函数只能画垂直线!
------解决方案--------------------
确实,GD库只能画竖直的虚线!