在WAP站点用GD(1.8版以上)生成WBMP
类别: PHP教程
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="start" title="Rectangle">
<p align="center">
<img src="rectangle.php" alt="Rectangle"/>
</p>
</card>
</wml>
rectangle.php
<?
Header("Content-type: image/vnd.wap.wbmp");
$im = imagecreate(90, 90);
$white = ImageColorAllocate($im, 255,255,255);
$black = ImageColorAllocate($im, 0,0,0);
ImageRectangle($im, 5, 5, 85, 85, $black);
ImageWBMP($im);
ImageDestroy($im);
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="start" title="Rectangle">
<p align="center">
<img src="rectangle.php" alt="Rectangle"/>
</p>
</card>
</wml>
rectangle.php
<?
Header("Content-type: image/vnd.wap.wbmp");
$im = imagecreate(90, 90);
$white = ImageColorAllocate($im, 255,255,255);
$black = ImageColorAllocate($im, 0,0,0);
ImageRectangle($im, 5, 5, 85, 85, $black);
ImageWBMP($im);
ImageDestroy($im);
?>
-= 资 源 教 程 =-
文 章 搜 索