imagecreatefromxpm

(PHP 4 >= 4.0.1, PHP 5, PHP 7)

imagecreatefromxpmTworzy nowy obraz z pliku lub URL

Opis

imagecreatefromxpm ( string $filename ) : resource

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

Wskazówka

Jeśli włączona jest dyrektywa konfiguracyjna fopen wrappers, możliwe jest podanie jako nazwy pliku adresu URL. Zobacz opis funkcji fopen() aby dowiedzieć się jak przekazać nazwę pliku, oraz fopen wrappers aby uzyskać listę obsługiwanych protokołów.

Parametry

filename

Path to the XPM image.

Zwracane wartości

Zwraca identyfikator zasobu obrazu w przypadku powodzenia lub FALSE w przypadku błędów.

Rejestr zmian

Wersja Opis
5.3.19 imagecreatefromxpm() is available on Windows.

Przykłady

Przykład #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);
?>

add a note add a note

User Contributed Notes

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