开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜