GD and Image 函数
在线手册:中文 英文
PHP手册

imagecreatefromxbm

(PHP 4 >= 4.0.1, PHP 5)

imagecreatefromxbm由文件或URL创建一个新图象

说明

resource imagecreatefromxbm ( string $filename )

imagecreatefromxbm() 返回一图像标识符,代表了从给定的文件名取得的图像。

Tip

如已启用fopen 包装器,在此函数中, URL 可作为文件名。关于如何指定文件名详见 fopen()。各种 wapper 的不同功能请参见 Supported Protocols and Wrappers,注意其用法及其可提供的预定义变量。

Warning

Windows 版本的 PHP 在 4.3.0 版之前不支持通过此函数访问远程文件,即使已经启用 allow_url_fopen.

参数

filename

Path to the XBM image.

返回值

成功后返回图象资源,失败后返回 FALSE

范例

Example #1 Convert an XBM image to a png image using imagecreatefromxbm()

<?php
// Load the xbm file
$xbm imagecreatefromxbm('./example.xbm');

// Convert it to a png file
imagepng($xbm'./example.png');
imagedestroy($xbm);
?>

注释

Warning

Windows 版本的 PHP 在 4.3.0 版之前不支持通过此函数访问远程文件,即使已经启用 allow_url_fopen.


GD and Image 函数
在线手册:中文 英文
PHP手册