imagecreatefromgd2
(PHP 4 >= 4.0.7, PHP 5)
imagecreatefromgd2 — Create a new image from GD2 file or URL
Descrizione
$filename
)Create a new image from GD2 file or URL.
È possibile utilizzare una URL come un nome di file con questa funzione se fopen wrappers è stata abilitata. Vedere fopen() per maggiori informazioni su come specificare i nomi di file. Vedere Supported Protocols and Wrappers per i link verso le informazioni sulle capacità dei vari wrapper, note sul loro uso, informazioni sulle variabili predefinite che forniscono.
Elenco dei parametri
-
filename -
Path to the GD2 image.
Valori restituiti
Restituisce un identificatore di risorsa immagine, FALSE in caso di errore.
Esempi
Example #1 imagecreatefromgd2() example
<?php
// Load the gd2 image
$im = imagecreatefromgd2('./test.gd2');
// Apply an effect on the image, in this
// case negate the image if PHP 5+
if(function_exists('imagefilter'))
{
imagefilter($im, IMG_FILTER_NEGATE);
}
// Save the image
imagegd2($im, './test_updated.gd2');
imagedestroy($im);
?>
Note
Nota: Questa funzione necessita di GD 2.0.1 o successivi (raccomandato 2.0.28 o successivi).
la versione per Windows di PHP antecedente la 4.3.0 non supporta l'accesso remoto ai file da parte di questa funzione, anche se allow_url_fopen è abilitato.
