question: public final static int caculateInSampleSize ( BitmapFactory . Options options , int rqsW , int rqsH ) { final int height = options . outHeight ; final int width = options . outWidth ; int inSampleSize = 1 ; if ( rqsW == 0 || rqsH == 0 ) return 1 ; if ( height > rqsH || width > rqsW ) { final int heightRatio = Math . round ( ( float ) height / ( float ) rqsH ) ; final int widthRatio = Math . round ( ( float ) width / ( float ) rqsW ) ; inSampleSize = heightRatio < widthRatio ? heightRatio : widthRatio ; } return inSampleSize ; }
target:  caculate the bitmap sampleSize