![](/img/trans.png)
[英]how to get the name of a selected image from gallery of images android studio
[英]How to get width and height of image in gallery android studio?
我在sdcard中有图片,即png样本大小为701 x 438。 在放入ImageView
之前,我想在我的应用程序中检索的大小。
如何在Java代码中获得此图像的实际大小?
我的意思是图像的实际宽度和高度。
您还可以使用BitmapRegionDecoder
以Bitmap的形式获取图像的实际高度和宽度。
BitmapRegionDecoder bitmapRegionDecoder = newInstance( pathName, isShareable);
从文件路径创建BitmapRegionDecoder
。
使用以下方法获取高度和宽度:
int getHeight()
返回原始图像的高度
int getWidth()
返回原始图像的宽度
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.