imageresolution() - gd函数(图像处理)
imageresolution()
(PHP 7 >= 7.2.0)
Get or set the resolution of the image
说明
imageresolution(resource $image): mixedimageresolution(resource $image,int $res_x[,int $res_y= $res_x]): mixedimageresolution() allows to set and get the resolution of an image in DPI(dots per inch). If none of the optional parameters is given, the current resolution is returned as indexed array. If only$res_xis given, the horizontal and vertical resolution are set to this value. If both optional parameters are given, the horizontal and vertical resolution are set to these values, respectively.
The resolution is only used as meta information when images are read from and written to formats supporting this kind of information(curently PNG and JPEG). It does not affect any drawing operations. The default resolution for new images is 96 DPI.
参数
$image由图象创建函数(例如imagecreatetruecolor())返回的图象资源。
$res_xThe horizontal resolution in DPI.
$res_yThe vertical resolution in DPI.
返回值
When used as getter(first signature), it returns an indexed array of the horizontal and vertical resolution on success,或者在失败时返回FALSE
. When used as setter(second signature), it returns TRUE
on success,或者在失败时返回FALSE
.
范例
Setting and getting the resolution of an image
以上例程会输出:
Array ( [0] => 200 [1] => 200 ) Array ( [0] => 300 [1] => 72 )
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!