load Png Stream From Assets - Android Graphics

Android examples for Graphics:PNG Image

Description

load Png Stream From Assets

Demo Code


//package com.java2s;
import android.content.Context;

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

public class Main {
    public static final String PNG_EXTENSION = ".png";

    public static InputStream loadPngStreamFromAssets(Context context,
            String imageFile) throws IOException {
        InputStream inputStream = null;
        inputStream = context.getAssets().open(imageFile + PNG_EXTENSION);
        return inputStream;
    }/*from w  w  w .  j  a v  a 2 s  .  co m*/
}

Related Tutorials