/**
* Creates a centered bitmap of the desired size.
* @param source
* @param recycle whether we want to recycle the input
*/
public static Bitmap extractMiniThumb(
Bitmap source, int width, int height, boolean recycle) {
if (source == null) {
return null;
}
float scale;
if (source.getWidth() < source.getHeight()) {
scale = width / (float) source.getWidth();
} else {
scale = height / (float) source.getHeight();
}
Matrix matrix = new Matrix();
matrix.setScale(scale, scale);
Bitmap miniThumbnail = transform(matrix, source, width, height, true, recycle);
return miniThumbnail;
}
ThumbnailUtil.java 文件源码
java
阅读 45
收藏 0
点赞 0
评论 0
项目:financisto1-holo
作者:
评论列表
文章目录