导航首页 »  技术教程 »  PHP:png2wbmp()的用法_GD库图像处理函数
PHP:png2wbmp()的用法_GD库图像处理函数 1172 2023-12-15   

png2wbmp

(PHP 4 >= 4.0.5, PHP 5)

png2wbmp — 将 PNG 图像文件转换为 WBMP 图像文件

说明

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

将名为 pngname 的 PNG 文件转换为 WBMP 格式,并存为 wbmpname。用 d_heightd_width 指定目标图像的高度和宽度。

参数

pngname

PNG 文件的路径。

wbmpname

目标 WBMP 文件的路径。

dest_height

目标图像的高度。

dest_width

目标图像的宽度。

threshold

阈值,在 0 到 8 之间(含)。

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

范例

Example #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);
?>

注释

Note: WBMP 支持仅在 PHP 与 GD-1.8 或更高版本一起编译时可用。

参见

jpeg2wbmp() - 将 JPEG 图像文件转换为 WBMP 图像文件



文章评论 (0条)
发表评论
暂无评论,快来抢沙发吧~