phpday 2027 - Call for Papers

imagecreatefrombmp

(PHP 7 >= 7.2.0, PHP 8)

imagecreatefrombmp — Crea una nuova immagine da un file o un URL

Descrizione

function imagecreatefrombmp(string $filename): GdImage|false

imagecreatefrombmp() returns an image identifier representing the image obtained from the given filename.

Suggerimento

È possibile utilizzare un URL come nome di file con questa funzione se i fopen wrapper sono stati abilitati. Vedere fopen() per maggiori dettagli su come specificare il nome del file. Vedere Protocolli e Wrapper supportati per i link alle informazioni sulle capacità dei vari wrapper, note sul loro uso e informazioni sulle eventuali variabili predefinite che forniscono.

Elenco dei parametri

filename

Path to the BMP image.

Valori restituiti

Restituisce un oggetto immagine in caso di successo, false in caso di errore.

Log delle modifiche

Versione Descrizione
8.0.0 On success, this function returns a GDImage instance now; previously, a resource was returned.

Esempi

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

+add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top