InputStream is = context.getResources().openRawResource(R.drawable.app_sample_code); Bitmap img2= BitmapFactory.decodeStream(is);
Bitmap img=((BitmapDrawable)res.getDrawable(R.drawable.youricon)).getBitmap();
?
========================================
Resources r = this.getContext().getResources();
Inputstream is = r.openRawResource(R.drawable.my_background_image);
BitmapDrawable? bmpDraw = new BitmapDrawable(is);
Bitmap bmp = bmpDraw.getBitmap();
?