解决Bitmap转Drawable尺寸变小的问题

// 设置bitmap转成drawable后尺寸不变
DisplayMetrics metrics = new DisplayMetrics();
((Activity)context).getWindowManager().getDefaultDisplay().getMetrics(metrics);
Resources resources = new Resources(context.getAssets(), metrics, null);
// bitmap转drawable
Drawable drawable = new BitmapDrawable(resources, bitmap);

你可能感兴趣的:(解决Bitmap转Drawable尺寸变小的问题)