Java tutorial
//package com.java2s; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; public class Main { public static Bitmap resourceToBitmap(int res, Context context) { Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), res); return bitmap; } }