Java tutorial
//package com.java2s; import android.graphics.Rect; public class Main { public static int getSampleSizeOfNotTooLarge(Rect paramRect) { double d = paramRect.width() * paramRect.height() * 2.0D / 5242880.0D; if (d >= 1.0D) return (int) d; return 1; } }