Latest web development tutorials

PHP image2wbmp – 輸出WBMP圖片

PHP 圖像處理 PHP圖像處理

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

語法

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

image2wbmp() 從image 圖像創建一個名為filename 的WBMP 文件。 image 參數是某個創建圖像函數的返回值,例如imagecreatetruecolor()。

filename 參數是可選項,如果省略,則直接將原圖像流輸出。

實例

<?php
$file = 'php.jpg';
$image = imagecreatefrompng($file);
header('Content-type: ' . image_type_to_mime(IMAGETYPE_WBMP));
image2wbmp($file); // 直接将原图像流输出
?>

PHP 圖像處理 PHP圖像處理