PHP生成图片
function randomString($length){//alphanumeric array widthout ambiguous chars
$alphanumericArr= array ('A','B','C','D','E','F','G','H','L','M','P','R','2','3','8','9');
shuffle($alphanumericArr);
$alphanumericArr = array_slice($alphanumericArr, 0, $length-1);
$string = join("",$alphanumericArr);
return $string;
}
function draw(){
header("Content-type: image/png");
$im = imagecreatetruecolor(400, 30);
$background = imagecolorallocate($im, 00, 0, 0);
$textcolor= imagecolorallocate($im, 255,255,255);
//imagefilledrectangle($im, 0, 0, 399, 29, $white);
//imagettftext($image,12,0,4,18,$textcolor);
imagettftext($im, 20, 0, 11, 21, $grey,2,randomString(5));
imagepng($im);
imagedestroy($im);
}
draw();
图像 “http://localhost/testing/admintool/codevolid.php” 因其本身有错无法显示。
请帮帮忙!!
br />
<b>Warning</b>:imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Invalid font filename in <b>F:\easeyoo\a.php</b> on line <b>24</b><br />
.................提示信息... imagettftext ( resource image, float size, float angle, int x, int y, int color, string fontfile, string text )
Note: This function requires both the GD library and the FreeType library.
确认安装了?
页:
[1]