Return to Snippet

Revision: 58586
at July 23, 2012 13:59 by l01241


Updated Code
private static Bitmap getBitmapFromAsset(Context context, String strName) {
			 
		AssetManager assetManager = context.getAssets();

	    InputStream istr;
	    Bitmap bitmap = null;
	    try {
	        istr = assetManager.open(strName);
	        bitmap = BitmapFactory.decodeStream(istr);
	    } catch (IOException e) {
	        return null;
	    }
	    
	    	    return bitmap;
	}

Revision: 58585
at July 23, 2012 13:53 by l01241


Initial Code
private static Bitmap getBitmapFromAsset(Context context, String strName) {
			 
		AssetManager assetManager = context.getAssets();

	    InputStream istr;
	    Bitmap bitmap = null;
	    try {
	        istr = assetManager.open(strName);
	        bitmap = BitmapFactory.decodeStream(istr);
	    } catch (IOException e) {
	        return null;
	    }
	    
	    	    return bitmap;
	}

Initial URL


Initial Description
private String mapPath = "img/full_map.png"; 
parkMapBitmap = getBitmapFromAsset(this.getContext(),mapPath);

Initial Title
get Bitmap From Asset

Initial Tags
image, android

Initial Language
Java