其他分享
首页 > 其他分享> > android 根据分辨率对图像进行缩放

android 根据分辨率对图像进行缩放

作者:互联网

原文链接:http://www.cnblogs.com/tracydj/archive/2011/11/02/2232635.html

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);

  

转载于:https://www.cnblogs.com/tracydj/archive/2011/11/02/2232635.html

标签:perc,mDpi,缩放,int,mDDpi,分辨率,float,org,android
来源: https://blog.csdn.net/weixin_30615767/article/details/97825519