dMar dMar - 1 year ago 120
Javascript Question

How to zoom a Canvas drawing

I'm trying to zoom in or out my canvas drawing, but if I only scale the context nothing happens.

Do I need to re-draw it after the scale? Is there any method to scale directly the context without drawing it every time I try to zoom in or out?

PS: I want to zoom in and out with an HTML5

<input type="range">
controlled by a script, and that's already working.

Answer Source

Like Mike said, the best solution is to redraw it. Zooming in with css is a solution, but there's a big loss in quality.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download