Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.File;

import java.io.FileOutputStream;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;

public class Main {

    public static void saveImageToPath(Bitmap bitmap, String imagepath) {
        File file = new File(imagepath);
        try {
            if (!file.exists()) {
                file.createNewFile();
            }
            bitmap.compress(CompressFormat.JPEG, 100, new FileOutputStream(file));// quality = 100
        } catch (Exception e) {
        }
    }
}