how to turn an image sideways or upside-down?

Viewed 9424

I have a custom view and i am using onDraw() to draw onto my canvas. I am drawing an image on this canvas.

I want to turn the image upside down kinda like flip on a horizontal line as a reference. This is not the same as rotating the image by 180 deg or -180 deg.

Likewise, i want to mirror or flip sidways i.e with a vertical line as it's pivot or reference. Again this is not the same as the canvas.rotate() provides.

I am wondering how to do it. Should i use a matrix or does canvas provide any method to do it like that of a "rotate".

Thanks.

1 Answers
Related