作者wingwindw (陈婷婷~亲亲)
看板PHP
标题Re: [请益] GD绘图
时间Thu Mar 1 17:48:54 2007
我照着这个范例做了一次
可是出现叉烧包耶!
php的gd版本有支援png
不知道问题出在哪..
有没有大大可以解惑
※ 引述《Vexed (!~!)》之铭言:
: 我其实没有用过gd 但我猜应该是这样才对
: 请把你的东西分成两页
: 一页是假设名字叫gd.php好了 内容如下
: <?php
: 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
: ImagePng ($img_handle);
: ?>
: 另一页则是这样
: <html>
: <head>
: <title>GD</title>
: </head>
: <body>
: <img src="gd.php" />
: </body>
: </html>
: 请试试 :)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.29.79.83
1F:→ antontw:你要不要先另存新档再用文字(或hex)编辑器去开 03/01 18:30
2F:→ antontw:因为 header 已经送了 image/png 所以 错误讯息应该看不到 03/01 18:31
3F:→ antontw:我觉得蛮有可能 php-gd.dll/so 还没 load 进来~ 03/01 18:32
4F:→ antontw:修正... 没 load 的话应该会抓不到 function ... 03/01 18:33