將 PNG 影象檔案轉換為 WBMP 影象檔案

png2wbmp

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

png2wbmp — 將 PNG 影象檔案轉換為 WBMP 影象檔案

說明

png2wbmp(
    string $pngname,
    string $wbmpname,
    int $dest_height,
    int $dest_width,
    int $threshold
): bool

將名為 pngname 的 PNG 檔案轉換為 WBMP 格式,並存為 wbmpname。用 d_height 和 d_width 指定目標影象的高度和寬度。

參數

pngname

PNG 檔案的路徑。

wbmpname

目標 WBMP 檔案的路徑。

dest_height

目標影象的高度。

dest_width

目標影象的寬度。

threshold

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

返回值

成功時返回 true, 或者在失敗時返回 false。

範例

示例 #1 png2wbmp() 例子

<?php
// Path to the target png
$path = './test.png';

// Get the image sizes
$image = getimagesize($path);

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

註釋

參見

  • jpeg2wbmp() - 將 JPEG 影象檔案轉換為 WBMP 影象檔案

Leave a Reply

Your email address will not be published. Required fields are marked *