Back to project page LucyTheMoocher.
The source code is released under:
MIT License
If you think the Android project LucyTheMoocher listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.lucythemoocher.graphics; //from w w w . jav a 2 s . c om import java.io.InputStream; import com.lucythemoocher.Globals.Globals; import android.graphics.drawable.BitmapDrawable; import android.util.SparseArray; public class PictureContainer { private SparseArray<BitmapDrawable> images_; public PictureContainer() { images_ = new SparseArray<BitmapDrawable>(); } BitmapDrawable getImage(int image) { BitmapDrawable img = images_.get(image); if ( img != null ) { return img; } else { // Only way to get good size... InputStream is = Globals.getInstance().getCamera().getResources().openRawResource(image); BitmapDrawable bd = new BitmapDrawable(is); images_.put(image, bd); return bd; } } }