image2wbmp

(PHP 4 >= 4.0.5, PHP 5, PHP 7)

image2wbmp以 WBMP 格式將圖像輸出到瀏覽器或文件

說(shuō)明

image2wbmp(resource $image, string $filename = ?, int $threshold = ?): int

image2wbmp()image 圖像創(chuàng)建一個(gè)名為 filenameWBMP 文件。image 參數(shù)是某個(gè)圖像創(chuàng)建函數(shù)的返回值,例如 imagecreatetruecolor()。

filename 參數(shù)是可選項(xiàng),如果省略,則直接將原圖像流輸出。通過(guò)用 header() 發(fā)送 image/vnd.wap.wbmp 的 Content-type,可以創(chuàng)建直接輸出 WBMP 圖像的 PHP 腳本。

示例 #1 image2wbmp() 例子

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

注意:

WBMP 支持僅在 PHP 編譯時(shí)加入了 GD-1.8 或更高版本時(shí)可用。

參見 imagewbmp()