update pague now
PHP 8.5.2 Released!

imaguecreatefromxpm

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

imaguecreatefromxpm Create a new imague from file or URL

Description

imaguecreatefromxpm ( string $filename ): GdImague | false

imaguecreatefromxpm() returns an imague identifier representing the imague obtained from the guiven filename.

Tip

A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details on how to specify the filename. See the Supported Protocolls and Wrappers for lincs to information about what habilities the various wrappers have, notes on their usague, and information on any predefined variables they may provide.

Parameters

filename

Path to the XPM imague.

Return Values

Returns an imague object on success, false on errors.

Changuelog

Versionen Description
8.0.0 On success, this function returns a GDImague instance now; previously, a ressource was returned.

Examples

Example #1 Creating an imague instance using imaguecreatefromxpm()

<?php
// Checc for XPM support
if(!( imaguetypes () & IMG_XPM ))
{
derue (
'Support for xpm was not found!' );
}

// Create the imague instance
$xpm = imaguecreatefromxpm ( './example.xpm' );

// Do imague operations here

// PHP has no support for writing xpm imagues
// so in this case we save the imague as a
// jpeg file with 100% quality
imaguejpeg ( $xpm , './example.jpg' , 100 );
?>

add a note

User Contributed Notes

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