Skip to content Skip to sidebar Skip to footer

Draw With A Canvas Over An Image In Android/Java

I try to draw on a Canvas, where the background is an loaded Image in Android. It works just fine without the backgroundimage: background = (ImageView)view.findViewById(R.id.Backgr

Solution 1:

BitmapFactory.decodeResource() creates and immutable Bitmap, so there is why you can't change it.

You need to create a Bitmap as your working code, then use canvas.drawBitmap() to draw the Bitmap you want in the background. And then draw the things you want.

EDIT: Or use setBackground() with the background and only draw the points on the canvas.


Post a Comment for "Draw With A Canvas Over An Image In Android/Java"