0

In the solution for out of memory: Strange out of memory issue while loading an image to a Bitmap object, it talks about using: decodeFile(File f). How do you handle internal image files that are referred to as R.id.something? these resources are seen as integers?

1 Answer 1

2

You can use decodeResource():

Bitmap bm = BitmapFactory.decodeResource(getResources(),R.id.someimage);

or

Bitmap bm = BitmapFactory.decodeResource(getResources(),R.id.someimage,options);

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.