安卓中如何获取图片尺寸
ITPOW2018/3/2 9:17:26
BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFile(filePath, options) options.outWidth; options.outHeight;
inJustDecodeBounds
为 true,表示 decodeFile 只是用来获取宽度、高度。否则的话 decodeFile 就是压缩图片。
相关阅读
安卓 ImageView 的使用及崩溃闪退、空白原因
<<返回首页<<