资源文件转换为Bitmap的两种方式

1.Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.mingchuseal, newOpts);
2.Drawable drawable = getResources().getDrawable(R.mipmap.mingchuseal);
BitmapDrawable bd = (BitmapDrawable) drawable;
final Bitmap bmm = bd.getBitmap(); 

猜你喜欢

转载自blog.csdn.net/weixin_37716758/article/details/84554276