Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.BitmapFactory.Options; public class Main { private static int computeImageSampleSize(Options options, int targetWidth, int targetHeight) { return Math.max(options.outWidth / targetWidth, options.outHeight / targetHeight); } }