Flip vertically an Android Canvas

2019-04-22 21:47发布

Is there an easy way to flip a canvas in Android? I cant seem to find anything that allows me to flip it vertically so that zero on the y-axis is the bottom of the phone screen instead of the top. It's OK if the solution isn't especially fast because I'm not doing anything computationally intense with the canvas.

Thanks in advance.

1条回答
Evening l夕情丶
2楼-- · 2019-04-22 22:23

Try

canvas.scale(1, -1, width / 2, height / 2)

See Canvas.scale documentation. The first two parameters are the amount to scale by.

查看更多
登录 后发表回答