Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static int checkSampleSize(int widCompare, int widthBitmap, int heightBitmap) {
        if (Math.max(widthBitmap, heightBitmap) > widCompare) {
            int inSampleSize = Math.max(widthBitmap, heightBitmap) / widCompare;

            if (Math.max(widthBitmap, heightBitmap) % widCompare != 0) {
                inSampleSize += 1;
            }

            return inSampleSize;
        }

        return 1;
    }
}