Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.BitmapFactory;

public class Main {

    private static void calculateInSampleSize(long requestPixels, BitmapFactory.Options options) {
        long picSize = options.outHeight * options.outWidth;
        int inSampleSize = (int) Math.sqrt(picSize / requestPixels);
        if (inSampleSize <= 1) {
            inSampleSize = 1;
        }
        options.inSampleSize = inSampleSize;
    }
}