函数名:image2wbmp()
适用版本:PHP 4 >= 4.0.5, PHP 5, PHP 7
用法:image2wbmp() 函数将图像以 WBMP(无损位图)格式保存到文件或输出到浏览器。
语法:bool image2wbmp ( resource $image [, string $filename [, int $foreground ]] )
参数:
返回值:成功时返回 true,失败时返回 false。
示例:
$image = imagecreatefromjpeg('image.jpg');
image2wbmp($image, 'image.wbmp');
imagedestroy($image);
$image = imagecreatefrompng('image.png');
header('Content-Type: image/vnd.wap.wbmp');
image2wbmp($image);
imagedestroy($image);
注意事项:
--with-gd 配置选项。image2wbmp() 前设置正确的 Content-Type 头信息,以便浏览器正确解析图像。