In My application i want to set the image on the canvas at the right bottom corner. So How i have to set that image in canvas ?
canvas.drawBitmap(bitmap , canvas.getWidth()-bitmap.getWidth() , canvas.getHeight()-bitmap.getHeight() , paint);
Get the x and y
coordinates by some simple calculation
Pseudo Code
x = canvas.width - image.width - padding
y = canvas.height - image.height - padding
canvas.drawBitmap(x,y,....)
EDIT: x = Math.max(0,x);
and y = Math.max(0,y);
incase the image is bigger than the canvas.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With