Android Open Source - android-tao-bitmap Bitmap I O






From Project

Back to project page android-tao-bitmap.

License

The source code is released under:

/******************************************************************************* * Copyright (c) 2014 Alexandr Tsvetkov. * All rights reserved. This program and the accompanying materials * are mad...

If you think the Android project android-tao-bitmap listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*******************************************************************************
 * Copyright (c) 2014 Alexandr Tsvetkov.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the The BSD 3-Clause License
 * which accompanies this distribution, and is available at
 * http://opensource.org/licenses/BSD-3-Clause
 * /* www .  j a  v  a2  s .c  om*/
 * Contributors:
 *     Alexandr Tsvetkov - initial API and implementation
 * 
 * Project:
 *     TAO Bitmap Utils
 * 
 * File name:
 *     BitmapIO.java
 *     
 * License agreement:
 *
 * 1. This code is published AS IS. Author is not responsible for any damage that can be
 *    caused by any application that uses this code.
 * 2. Author does not give a garantee, that this code is error free.
 * 3. This code can be used in NON-COMMERCIAL applications AS IS without any special
 *    permission from author.
 * 4. This code can be modified without any special permission from author IF AND ONLY IF
 *    this license agreement will remain unchanged.
 * 5. SPECIAL PERMISSION for this code usage in COMMERCIAL application SHOULD be obtained
 *    from author.
 ******************************************************************************/
package ua.at.tsvetkov.bitmap;

import java.io.IOException;
import java.io.InputStream;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

/**
 * IO for working with Bitmap
 * 
 * @author A.Tsvetkov 2014 http://tsvetkov.at.ua mailto:al@ukr.net
 */
public class BitmapIO {

   /**
    * Load Bitmap from Assets.
    * 
    * @param context
    * @param name
    * @return Bitmap
    * @throws IOException
    */
   public static Bitmap loadBitmapFromAssets(Context context, String name) throws IOException {
      InputStream is = null;
      Bitmap res = null;
      is = context.getAssets().open(name);
      res = BitmapFactory.decodeStream(is);
      is.close();
      return res;
   }

}




Java Source Code List

ua.at.tsvetkov.bitmap.BitmapCa?heIO.java
ua.at.tsvetkov.bitmap.BitmapConverter.java
ua.at.tsvetkov.bitmap.BitmapIO.java
ua.at.tsvetkov.bitmap.BitmapTransformer.java