public class ImageUtils {
public static Bitmap drawable2Bitmap(Drawable drawable) {
return ((BitmapDrawable) drawable).getBitmap();
}
public static Drawable bitmap2Drawable(Context context, Bitmap bitmap) {
return new BitmapDrawable(context.getResources(), bitmap);
}
}