imagecreatefromxpm
(PHP 4 >= 4.0.1, PHP 5, PHP 7)
imagecreatefromxpm - 从文件或 URL 创建一个新的图像
描述
resource imagecreatefromxpm ( string $filename )
imagecreatefromxpm()返回一个图像标识符,表示从给定文件名获得的图像。
提示
参数
filename
XPM 映像的路径。
返回值
成功时返回图像资源标识符,FALSE
错误。
更新日志
版 | 描述 |
---|---|
5.3.19 | imagecreatefromxpm()在 Windows 上可用。 |
示例
示例#1使用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);
?>
← imagecreatefromxbm
imagecreatetruecolor →
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com