是否可以从画布中获取像素大小?
E.g。我知道我可以直接从图像中获得尺寸:
list($width, $height) = @getimagesize($_FILES['inputFieldName']['tmp_name'])
但我想从画布中获取它。 E.g:
$canvas = imagecreatefromjpeg($image_path);
//Get image size from $canvas
答案 0 :(得分:1)
尝试:
$canvas = imagecreatefromjpeg($image_path);
$width = imagesx($canvas);
$height = imagesy($canvas);
http://es1.php.net/manual/en/function.imagesx.php和http://es1.php.net/manual/en/function.imagesy.php
的详细信息