Reputation: 627
I would like to add an image (Bitmap) over another one. For that I am only using Bitmaps (fot the image I draw in and the image I add), but the Bitmap I am using is actually a resource in my drawable resource. So Is there a way to create a Bitmap
that contains my drawable ?
Upvotes: 0
Views: 2119
Reputation: 1967
Try this:
Bitmap bitmap= BitmapFactory.decodeResource(context.getResources(),
R.drawable.icon_name);
Upvotes: 1
Reputation: 9700
Use decodeResource()
of BitmapFactory
to convert drawable resource into Bitmap
as follows...
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.your_drawable);
Upvotes: 2