关于 bitmap和 drawable相互转换。
Drawable drawable = new BitmapDrawable(getResources(), path);
本地图片 转换成 bitmap file 文件的图片地址
/** * 将本地文件转换为 Drawable */ public static Drawable iconDrawable(String path, Context mContext) { Drawable drawable = null; //如果主题 图片 为null 则读取默认的图片 if (TextUtils.isEmpty(path) || null == mContext) { return drawable; } File file = new File(path); if (file.exists()) { drawable = new BitmapDrawable(mContext.getResources(), path); if (drawable != null && ((BitmapDrawable) drawable).getBitmap() != null && ((BitmapDrawable) drawable).getBitmap().getByteCount() > 0) { return drawable; } } return drawable; }