inSampleSize的参数是怎么计算出来的?它有什么用?

 Bitmap bitmap = null;  
 BitmapFactory.Options opts = new BitmapFactory.Options();  
 opts.inJustDecodeBounds = true;  
 BitmapFactory.decodeFile(filePath, opts);  

 opts.inSampleSize = computeSampleSize(opts, -1, 128*128);  
 opts.inJustDecodeBounds = false;  

 try {  
     bitmap = BitmapFactory.decodeFile(filePath, opts);  
 }catch (Exception e) {  
    // TODO: handle exception  
} 
查看全部
china_hgb
china_hgb
2016/02/05 23:07
  • exception
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

3个回复