array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.png2wbmp.php', 1 => 'png2wbmp', ), 'up' => array ( 0 => 'ref.image.php', 1 => 'GD 和图像处理 函数', ), 'prev' => array ( 0 => 'function.jpeg2wbmp.php', 1 => 'jpeg2wbmp', ), 'next' => array ( 0 => 'class.gdimage.php', 1 => 'GdImage', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/image/functions/png2wbmp.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.5, PHP 5, PHP 7)
png2wbmp — 将 PNG 图像文件转换为 WBMP 图像文件
本函数已自 PHP 7.2.0 起被废弃,并自 PHP 8.0.0 起被移除。 强烈建议不要依赖本函数。
$pngname
,$wbmpname
,$dest_height
,$dest_width
,$threshold
转换 PNG 文件到 WBMP 文件。
pngname
PNG 文件的路径。
wbmpname
目标 WBMP 文件的路径。
dest_height
目标图像的高度。
dest_width
目标图像的宽度。
threshold
阈值,在 0 到 8 之间(含)。
示例 #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);
?>