Java tutorial
//package com.java2s; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; public class Main { public static Bitmap drawableTobitmap(int bmpid, Context ctx) { Resources res = ctx.getResources(); BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 1; return BitmapFactory.decodeResource(res, bmpid, options); } }