private int computeScale(BitmapFactory.Options options,int viewWidth,int viewHeight){
  int inSampleSize=1;
  if (viewWidth == 0 || viewWidth == 0) {
    return inSampleSize;
  }
  int bitmapWidth=options.outWidth;
  int bitmapHeight=options.outHeight;
  if (bitmapWidth > viewWidth || bitmapHeight > viewWidth) {
    int widthScale=Math.round((float)bitmapWidth / (float)viewWidth);
    int heightScale=Math.round((float)bitmapHeight / (float)viewWidth);
    inSampleSize=widthScale < heightScale ? widthScale : heightScale;
  }
  return inSampleSize;
}

private int computeScale ( BitmapFactory . Options options , int viewWidth , int viewHeight ) { int inSampleSize = 1 ; if ( viewWidth == 0 || viewWidth == 0 ) { return inSampleSize ; } int bitmapWidth = options . outWidth ; int bitmapHeight = options . outHeight ; if ( bitmapWidth > viewWidth || bitmapHeight > viewWidth ) { int widthScale = Math . round ( ( float ) bitmapWidth / ( float ) viewWidth ) ; int heightScale = Math . round ( ( float ) bitmapHeight / ( float ) viewWidth ) ; inSampleSize = widthScale < heightScale ? widthScale : heightScale ; } return inSampleSize ; }
according view in width and height to calculate the bitmap scaling . the default is not scaled
