I’m drawing an image using Canvas.drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint). I want to flip the image for left and right movement but I cant use a matrix with this method. I can rotate using canvas.rotate but thats no use for flipping, any ideas?
I’m drawing an image using Canvas.drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint). I
Share
You can do it using scale + translate. The following code flips left-to-right:
Without translate your bitmap will be drawn with negative coordinates – outside the left edge of screen.