作者uNielsa (uNielsa)
看板PHP
标题[请益] GD绘图
时间Thu May 4 20:20:43 2006
用网路上的范例跑不出来>"<
用火狐开显示:无法显示错误的图片
用IE开则显示一堆乱码...
请问如何解决<(_ _)>
谢谢各位高手
--
以下是GD资讯:
array(11) {
["GD Version"]=> string(27) "bundled (2.0.28 compatible)"
["FreeType Support"]=> bool(true)
["FreeType Linkage"]=> string(13) "with freetype"
["T1Lib Support"]=> bool(false)
["GIF Read Support"]=> bool(true)
["GIF Create Support"]=> bool(true)
["JPG Support"]=> bool(true)
["PNG Support"]=> bool(true)
["WBMP Support"]=> bool(true)
["XBM Support"]=> bool(true)
["JIS-mapped Japanese Font Support"]=> bool(false) } ?>
以下是范例
<html>
<head>
<title>GD</title>
</head>
<body>
<?
header ("Content-type: image/png");
$img_handle = ImageCreate (230, 20) or die ("Cannot Create image");
$back_color = ImageColorAllocate ($img_handle, 0, 10, 10);
$txt_color = ImageColorAllocate ($img_handle, 233, 114, 191);
ImageString ($img_handle, 31, 5, 5, "My first Program with GD", $txt_color);
ImagePng ($img_handle);
?>
</body>
</html>
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.123.237.138
1F:推 ckmarkhsu:好歹也放个 img 标签XD 可以将 echo 出来下载看看 05/04 22:23
2F:推 uniXiang:终於找到了 07/25 10:45