PHP Conference Japan 2024

png2wbmp

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

png2wbmp將 PNG 影像檔轉換為 WBMP 影像檔

警告

此函式自 PHP 7.2.0 起已被標記為 *已棄用*,並自 PHP 8.0.0 起已被 *移除*。強烈建議不要依賴此函式。

說明

png2wbmp(
    字串 $pngname,
    字串 $wbmpname,
    整數 $dest_height,
    整數 $dest_width,
    整數 $threshold
): 布林值

將 PNG 檔案轉換為 WBMP 檔案。

參數

pngname

PNG 檔案的路徑。

wbmpname

目標 WBMP 檔案的路徑。

dest_height

目標圖片高度。

dest_width

目標圖片寬度。

threshold

閾值,介於 0 到 8 之間(含)。

返回值

成功時返回 true,失敗時返回 false

注意

然而,如果 libgd 無法輸出圖片,此函數會返回 true

範例

範例 #1 png2wbmp() 範例

<?php
// 目標 png 的路徑
$path = './test.png';

// 取得圖片大小
$image = getimagesize($path);

// 轉換圖片
png2wbmp($path, './test.wbmp', $image[1], $image[0], 7);
?>

另請參閱

  • jpeg2wbmp() - 將 JPEG 圖片檔案轉換為 WBMP 圖片檔案
新增註釋

使用者貢獻的註釋 1 則註釋

Window Bump Map
16 年前
WBMP 不是 Windows 點陣圖,它是無線點陣圖。只是要清楚地說明這一點。
To Top