导航首页 » 技术教程 » PHP:image2wbmp()的用法_GD库图像处理函数
PHP:image2wbmp()的用法_GD库图像处理函数 176 2023-12-15   

image2wbmp

(PHP 4 >= 4.0.5, PHP 5)

image2wbmp — 以 WBMP 格式将图像输出到浏览器或文件

说明

int image2wbmp ( resource $image [, string $filename [, int $threshold ]] )

image2wbmp()image 图像创建一个名为 filename 的 WBMP 文件。image 参数是某个图像创建函数的返回值,例如 imagecreatetruecolor()。

filename 参数是可选项,如果省略,则直接将原图像流输出。通过用 header() 发送 image/vnd.wap.wbmp 的 Content-type,可以创建直接输出 WBMP 图像的 PHP 脚本。

Example #1 image2wbmp() 例子

<?php
$file = 'php.jpg';
$image = imagecreatefrompng($file);
header('Content-type: ' . image_type_to_mime(IMAGETYPE_WBMP));
image2wbmp($file); // output the stream directly
?>

Note:

WBMP 支持仅在 PHP 编译时加入了 GD-1.8 或更高版本时可用。

参见 imagewbmp()。


!!!站长长期在线接!!!

网站、小程序:定制开发/二次开发/仿制开发等

各种疑难杂症解决/定制接口/定制采集等

站长微信:lxwl520520

站长QQ:1737366103