array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.png2wbmp.php', 1 => 'png2wbmp', ), 'up' => array ( 0 => 'ref.image.php', 1 => 'Funções de GD e Image', ), 'prev' => array ( 0 => 'function.jpeg2wbmp.php', 1 => 'jpeg2wbmp', ), 'next' => array ( 0 => 'class.gdimage.php', 1 => 'GdImage', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'pt_BR', '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 — Converte arquivo de imagem PNG em WBMP
Esta função tornou-se DEFASADA a partir do PHP 7.2.0 e foi REMOVIDA a partir do PHP 8.0.0. O uso desta função é fortemente desencorajado.
$pngname
,$wbmpname
,$dest_height
,$dest_width
,$threshold
Converte um arquivo PNG em um WBMP.
pngname
Caminho para o arquivo PNG.
wbmpname
Caminho para o arquivo WBMP de destino.
dest_height
Altura da imagem de destino.
dest_width
Largura da imagem de destino.
threshold
Valor de limite, entre 0 e 8 (inclusive).
Retorna true
em caso de sucesso ou false
em caso de falha.
Entretanto, se a biblioteca libgd falhar ao gerar a imagem, esta função retornará true
.
Exemplo #1 Exemplo de png2wbmp()
<?php
// Caminho para o PNG alvo
$path = './test.png';
// Obtém o tamanho da imagem
$image = getimagesize($path);
// Converte a imagem
png2wbmp($path, './test.wbmp', $image[1], $image[0], 7);
?>