相关疑难解决方法(0)

如何获取android中使用的图像的高度和宽度

我想获得ImageView中的图像的高度和宽度,或者在android模拟器中获取背景图片.请帮助我,任何帮助都会被appriciated.

android dimensions imageview android-bitmap

25
推荐指数
1
解决办法
6万
查看次数

Android - 位图的宽度和高度,不加载它

我需要获取位图的宽度和高度,但使用它会产生内存不足异常:

    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是什么?

android bitmap

15
推荐指数
2
解决办法
2万
查看次数

标签 统计

android ×2

android-bitmap ×1

bitmap ×1

dimensions ×1

imageview ×1