资源文件转drawable文件
Resources resources = mContext.getResources();
Drawable drawable = resources.getDrawable(R.drawable.a);
imageview.setBackground(drawable);
资源文件转Bitmap
BitmapFactory.decodeResource(getResources(), R.drawable.appicon))
资源文件转drawable文件
Resources resources = mContext.getResources();
Drawable drawable = resources.getDrawable(R.drawable.a);
imageview.setBackground(drawable);
资源文件转Bitmap
BitmapFactory.decodeResource(getResources(), R.drawable.appicon))
本文标题:Android 资源文件转Drawable、Bitmap
本文链接:https://www.haomeiwen.com/subject/jbyovftx.html
网友评论