Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 *  COPYRIGHT NOTICE  
 *  Copyright (C) 2015, ticktick <lujun.hust@gmail.com>
 *  http://ticktick.blog.51cto.com/
 *   
 *  @license under the Apache License, Version 2.0 
 *
 *  @file    BitmapHelper.java
 *  @brief   Bitmap processor, include load,save,rotate,crop etc.
 *  
 *  @version 1.0     
 *  @author  ticktick
 *  @date    2015/01/14    
 */

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import android.graphics.Bitmap;

import android.graphics.Bitmap.CompressFormat;

public class Main {
    public static void save(Bitmap bitmap, String filepath) {
        try {
            FileOutputStream fos = new FileOutputStream(filepath);
            bitmap.compress(CompressFormat.JPEG, 100, fos);
            bitmap.recycle();
            fos.close();
        } catch (FileNotFoundException e) {

        } catch (IOException e) {

        }
    }
}