我需要获取位图的宽度和高度,但使用以下代码会导致内存溢出异常:
Resources res=getResources();
Bitmap mBitmap = BitmapFactory.decodeResource(res, R.drawable.pic);
BitmapDrawable bDrawable = new BitmapDrawable(res, mBitmap);
//get the size of the image and the screen
int bitmapWidth = bDrawable.getIntrinsicWidth();
int bitmapHeight = bDrawable.getIntrinsicHeight();
我在这个问题的答案Get bitmap width and height without loading to memory中读到了解决方法,但是这里的inputStream是什么?