略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: imagecreatefrombmp

2024-03-29

imagecreatefrombmp

(PHP 7 >= 7.2.0, PHP 8)

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

说明

imagecreatefrombmp(string $filename): GdImage|false

imagecreatefrombmp() returns an image identifier representing the image obtained from the given filename.

小技巧

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

参数

filename

Path to the BMP image.

返回值

成功后返回图象对象,失败后返回 false

更新日志

版本 说明
8.0.0 On success, this function returns a GDImage instance now; previously, a resource was returned.

范例

示例 #1 Convert an BMP image to a PNG image using imagecreatefrombmp()

<?php
// Load the BMP file
$im imagecreatefrombmp('./example.bmp');

// Convert it to a PNG file with default settings
imagepng($im'./example.png');
imagedestroy($im);
?>
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/function.imagecreatefrombmp.php

冷却塔厂家 广告
-- 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3