(PHP 7 >= 7.2.0, PHP 8)
imagecreatefrombmp — Cria uma nova imagem a partir de arquivo ou URL
$filename
) : GdImage|falseimagecreatefrombmp() returns an image identifier representing the image obtained from the given filename.
Uma URL pode ser utilizada como um nome de arquivo se fopen wrappers estiver ativo. Veja fopen() para mais detalhes em como especificar o filename. Veja também the Protocolos e Wrappers suportados para informações sobre que capacidades cada wrapper tem, notas de uso e informações sobre variáveis predefinidas fornecidas.
filename
Path to the BMP image.
Retorna um resource de imagem no sucesso, false
em erros.
Versão | Descrição |
---|---|
8.0.0 | On success, this function returns a GDImage instance now; previously, a resource was returned. |
Exemplo #1 Convert an BMP image to a PNG image using imagecreatefrombmp()
<?php
// Load the BMP file
$im = imagecreatefrombmp('./example.bmp');
// Convert it to a PNG file with default settings
imagepng($im, './example.png');
imagedestroy($im);
?>