Android Bitmap Load loadBitmapFromAssets(Context context, String name)

Here you can find the source of loadBitmapFromAssets(Context context, String name)

Description

load Bitmap From Assets

Declaration

public static Bitmap loadBitmapFromAssets(Context context, String name) 

Method Source Code

//package com.java2s;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

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

public class Main {
    public static Bitmap loadBitmapFromAssets(Context context, String name) {
        try {/*from   w  w  w. j av a2  s . c o m*/
            InputStream is = context.getAssets().open(name);
            Bitmap bitmap = BitmapFactory.decodeStream(is);
            return bitmap;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. loadBitmap(String bitmapUrl, ImageView imageView, int reqWidth, int reqHeight)
  2. loadBitmap(String url)
  3. loadBitmap(String url)
  4. loadBitmap(String url)
  5. loadBitmapAsset(Context context, String asset)
  6. loadBitmapFromStorage(String path)
  7. loadImage(String filename)
  8. loadImage(String urlStr)
  9. loadPreviewBitmap(String fileName, int width, int height)