Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;

public class Main {
    public static final int DEF_MAP_SAMPLE = 16;

    public static Bitmap obtainPreviewMap(String path, int sample) {
        Options opts = new Options();
        opts.inSampleSize = sample;
        return BitmapFactory.decodeFile(path, opts);
    }

    public static Bitmap obtainPreviewMap(String path) {
        return obtainPreviewMap(path, DEF_MAP_SAMPLE);
    }
}