首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

png2wbmp

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

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

警告

从PHP 7.2.0开始,png2wbmp()已被弃用,并且自PHP 8.0.0起将被删除。改为使用imagecreatefrompng()和imagewbmp()。

描述

代码语言:javascript
复制
bool png2wbmp ( string $pngname , string $wbmpname , int $dest_height , int $dest_width , int $threshold )

将PNG文件转换为WBMP文件。

参数

pngname

PNG文件的路径。

wbmpname

目标WBMP文件的路径。

dest_height

目标图片高度。

dest_width

目的图像宽度。

threshold

阈值,介于0和8(含)之间。

返回值

成功返回TRUE或失败时返回FALSE。

例子

示例#1 png2wbmp()示例

代码语言:javascript
复制
<?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图像文件

← jpeg2wbmp

扫码关注腾讯云开发者

领取腾讯云代金券