[英]How to get image size from a canvas?
是否可以從畫布獲取以像素為單位的圖像大小?
例如,我知道我可以實現直接從圖像獲取尺寸的方法:
list($width, $height) = @getimagesize($_FILES['inputFieldName']['tmp_name'])
但我想從畫布上得到它。 例如:
$canvas = imagecreatefromjpeg($image_path);
//Get image size from $canvas
嘗試:
$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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.