Java tutorial
//package com.java2s; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; public class Main { /** * Return a Bitmap from an Android resource id (e.g. R.drawable...) * @param ctx * @param bitmapId * @return Bitmap */ public static Bitmap makeBitmap(Context ctx, int bitmapId) { return (BitmapFactory.decodeResource(ctx.getResources(), bitmapId)); } }