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;

public class Main {
    public static synchronized Bitmap decodeSampledBitmapFromFile(String path) {

        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inSampleSize = 1;
        options.outMimeType = "image/jpeg";
        options.inDither = false;
        options.inPurgeable = true;
        options.inInputShareable = true;
        options.inPreferredConfig = Bitmap.Config.ARGB_8888;
        options.inTempStorage = new byte[256];

        return BitmapFactory.decodeFile(path, options);
    }
}