【问题标题】:get Width and height of image php from imageCreateFromBMP($src)从 imageCreateFromBMP($src) 获取图像 php 的宽度和高度
【发布时间】:2018-07-05 11:25:01
【问题描述】:

我想使用 imageCreateFromBMP($src) 而不是 $src 从返回图像中知道图像的图像宽度和高度。我怎样才能做到这一点?

$src = 'four.bmp'; //src of image
$im = imagecreatefrombmp($src); 
list($width, $height) = GetImageSize($im); // it doesnot work though it takes string 
echo 'Image width '.$width.'</br>';
echo 'Image height '.$height.'</br>';

【问题讨论】:

  • imagesx()imagesy() 获取图片资源
  • 谢谢你!写下答案..我会接受你的答案:)

标签: php image height width


【解决方案1】:

imagesx()imagesy()获取图片资源

例子:

$src = 'four.bmp'; //src of image
$im = imagecreatefrombmp($src); 
$width = imagesx($im);
$height = imagesy($im);
echo 'Image width '.$width.'</br>';
echo 'Image height '.$height.'</br>';

【讨论】:

    猜你喜欢
    • 2011-11-26
    • 2020-10-27
    • 1970-01-01
    • 2014-07-15
    • 2015-09-04
    • 2010-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多