我想获得ImageView中的图像的高度和宽度,或者在android模拟器中获取背景图片.请帮助我,任何帮助都会被appriciated.
我需要获取位图的宽度和高度,但使用它会产生内存不足异常:
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();
Run Code Online (Sandbox Code Playgroud)
我在问题上阅读解决方案获取位图宽度和高度而不加载到内存但这里的inputStream是什么?