PrepAway - Latest Free Exam Questions & Answers

Which of these is the correct code to create a Bitmap object using the file res/drawable/image.png?

Which of these is the correct code to create a Bitmap object using the file
res/drawable/image.png?

PrepAway - Latest Free Exam Questions & Answers

A.
Bitmap img = BitmapFactory.decodeFile(R.drawable.image),

B.
Bitmap img = BitmapFactory.decodeResource(R.drawable.image);

C.
Bitmap img = new Bitmap(R.drawable.image);

D.
Bitmap img = (Bitmap)GraphicsFactory.decodeResouces(R.drawable.image);

Explanation:

One Comment on “Which of these is the correct code to create a Bitmap object using the file res/drawable/image.png?


Leave a Reply

Your email address will not be published. Required fields are marked *