首页 > 移动平台 > 详细

Android 该表位图的宽度

时间:2015-07-11 14:51:09      阅读:140      评论:0      收藏:0      [点我收藏+]

public Bitmap resizedBitmap(Bitmap bitmap, int screenW, int tv_count) {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
int newWidth = screenW / tv_count;
int newHeight = 15;

// calculate the scale - in this case = 0.4f
float scaleWidth = ((float) newWidth) / width;
float scaleHeight = ((float) newHeight) / height;

Matrix matrix = new Matrix();
// resize the bit map
matrix.postScale(scaleWidth, scaleHeight);

Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height,
matrix, true);

return resizedBitmap;
}

Android 该表位图的宽度

原文:http://www.cnblogs.com/AchillesSnow/p/4638468.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!