发布网友
共1个回答
热心网友
先找到这个控件,把drawble转换成bitmap,然后获取bitmap的宽高即可。主要代码如下:
Bitmap bitmap = BitmapFactory.decodeResource(this.getResources(), R.id.XXX);
int height = bitmap.getHeight();
int width= bitmap.getWidth();