Java (Android) Paste Icon to Canvas
So, I have a custom view where I draw on a canvas. I would like to add an icon or image to the canvas. I tried with
canvas.setBackgroundResource(R.drawable.image_name)
The problem here is that my icon has been resized to fit the screen and I have no control to resize or scale the image.
Maybe I can get the height and width of the canvas and then create a Drawable / bitmap with an unscaled icon and fill the background with some color? Can anyone point me in the right direction?
+3
source to share