(PHP 4 >= 4.0.1, PHP 5)
imagecreatefromxpm — 由文件或 URL 建立一個新影響。
$filename
)imagecreatefromxpm() returns an image identifier representing the image obtained from the given filename.
如果「fopen wrappers」已經被啟用,則在本函式中可以把 URL 作為檔案名來使用。請參閱 fopen() 函式來獲取如何指定文件名的詳情以及支援 URL 協定列表:Supported Protocols and Wrappers。
filename
Path to the XPM image.
成功後回傳影像資源,失敗則回傳 FALSE
。
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);
?>
Note: 本函式未在 Windows 平台下實作。