运行一下以下代码
$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);
imagedashedline($img, 20, 20, 500, 20, $white);
imagedashedline($img, 20, 20, 20, 500, $white);
header("content-type:image/jpeg");
imagejpeg($img);
imagedestroy($img);
你会发现垂直的虚线没问题,但水平虚线就不显示。有谁知道为什么?
$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, 20, 500, IMG_COLOR_STYLED);
也是一样。
$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);