image2wbmp

(PHP 4 >= 4.0.5, PHP 5)

image2wbmp -- 以 WBMP 格式將圖像輸出到瀏覽器或檔案

說明

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

image2wbmp()image 圖像建立一個名為 filenameWBMP 檔案。image 參數是某個圖像建立函數的返回值,例如 imagecreatetruecolor()

filename 參數是可選項,若果省略,則直接將原圖像流輸出。通過用 header() 傳送 image/vnd.wap.wbmp 的 Content-type,可以建立直接輸出 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 編譯時加入了 GD-1.8 或更高版本時可用。

參見 imagewbmp()