imagecreatefromxpm
(PHP 4 >= 4.0.1, PHP 5)
imagecreatefromxpm — Crea una nuova immagine da un file o una URL
Descrizione
$filename
)imagecreatefromxpm() returns an image identifier representing the image obtained from the given filename.
È 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 XPM image.
Valori restituiti
Restituisce un identificatore di risorsa immagine, FALSE in caso di errore.
Esempi
Example #1 Creating an image instance using imagecreatefromxpm()
<?php
// Check for XPM support
if(!(imagetypes() & IMG_XPM))
{
die('Support for xpm was not found!');
}
// Create the image instance
$xpm = imagecreatefromxpm('./example.xpm');
// Do image operations here
// PHP has no support for writing xpm images
// so in this case we save the image as a
// jpeg file with 100% quality
imagejpeg($xpm, './example.jpg', 100);
imagedestroy($xpm);
?>
Valori restituiti
Nota: Questa funzione è disponibile solo se il PHP è compilato con la libreria GD allegata.
Nota: Questa funzione non è implementata sulle piattaforme Windows.
