How to change the size of the path?

I am trying to make an Android application that works with finger paint, and this should be able to control scaling. So I have an image in the background and I draw it, but when I zoom in and out, I need to resize the image and the distance traveled, and I donโ€™t know how to do it. I used Zdnet code to implement a pinch to increase gestures , and it works great for a background image, so I thought the only step to make a โ€œpath changeโ€ was to put mPath.transform (matrix) at the end of onTouch () but this does not allow me to draw correctly and not resize the path. How can i do this?

Note: Google finger paint implementation code.

+4
source share
1 answer

mPath.transform should work, it's hard to say what is wrong without code.

Alternatively, you can use Canvas.scale if you want to scale everything drawn with the same factor.

0
source

Source: https://habr.com/ru/post/1345569/


All Articles