array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.imagecreatefromxbm.php', 1 => 'imagecreatefromxbm', ), 'up' => array ( 0 => 'ref.image.php', 1 => 'GD 和图像处理 函数', ), 'prev' => array ( 0 => 'function.imagecreatefromwebp.php', 1 => 'imagecreatefromwebp', ), 'next' => array ( 0 => 'function.imagecreatefromxpm.php', 1 => 'imagecreatefromxpm', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/image/functions/imagecreatefromxbm.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8)
imagecreatefromxbm — 由文件或 URL 创建一个新图象。
imagecreatefromxbm() 返回图像标识符,代表从指定文件名获得的图像。
如已启用fopen 包装器,在此函数中, URL 可作为文件名。关于如何指定文件名详见 fopen()。各种 wapper 的不同功能请参见 支持的协议和封装协议,注意其用法及其可提供的预定义变量。
filename
XBM 图像路径。
成功后返回图象对象,失败后返回 false
。
示例 #1 使用 imagecreatefromxbm() 转换 XBM 图像为 png 图像
<?php
// Load the xbm file
$xbm = imagecreatefromxbm('./example.xbm');
// Convert it to a png file
imagepng($xbm, './example.png');
imagedestroy($xbm);
?>