+ 2
How to zoom in and zoom out a canvas image ?
I have done something but i am not sure if this is the right way to do it or if it even works!! https://code.sololearn.com/WMXk3QVy6MrH/?ref=app Ty in advance!
4 Answers
+ 3
scale function would transform the position proportionally, need to refactor it if origin point is not at 0,0.
Use setTransform to reset the transform
https://code.sololearn.com/W0zH09bPaUV5/?ref=app
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/scale
+ 2
You could zoom in and out by changing a scale() function. Ex. Change zoom on click or on scroll
0
CalviŐ˛ tyvm !
- 1
Aleksei Radchenkov kindly read the description. And i know i can use scale and touch or scroll(that's a different topic), and in fact i have used it as well here but it's not easy to scale things up and down when it comes to canvas and that is what my question is about . Ty though!