android 根据分辨率对图像进行缩放
mDDpi = 0xF0;
mDpi = 0xA0;
if (mDDpi != mDpi) {
float perc = (float) mDpi / (float) mDDpi;
int width = (int) (org.getWidth() * perc);
int height = (int) (org.getHeight() * perc);
org = Bitmap.createScaledBitmap(org, width, height, true);
}
Drawable draw = new BitmapDrawable(getResources(), org);
posted on 2011-11-02 10:05 John Smith 阅读(398) 评论(0) 收藏 举报
浙公网安备 33010602011771号