Android-Graphics : BitmapFactory() returns only immutable object for src images
I am facing a problem while decoding an image:
Bitmap bMap = BitmapFactory.decodeResource(getResources(), R.drawable.smile);
mCanvas = new Canvas(bMap);
as BitmapFactory.decodeResource()
returns an immutable object, which we cannot pass to the constructor of Canvas
class.
Can I use the function
BitmapFactory.decodeResource(getRe开发者_运维技巧sources(),Resource, option opt)
as BitmapFactory.options()
is used for making the bitmap factory to return only mutable objects, no matter if the image is from "src" or dynamic.
Please help me out to create an image into canvas.
精彩评论