I would like to create a zoom function inside an extension file js, I already have a canvas function, however in my drawing it is coming out too small depending on the initial coordinates, so I would like something that when I needed I could give zoom in on the figure. My canvas function is:
function fcanvas(){
var scale = 1;
var originx = 0;
var originy = 0;
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.strokeStyle = '#000000';
ctx.lineWidth = 2;
ctx.font='20px Arial';
ctx.beginPath();
ctx.moveTo(500,250)
ctx.lineTo(500,250-(aa));
ctx.lineTo(500-(-bb),250 );
ctx.lineTo(500,250);
ctx.font='12px Arial';
ctx.fillText("Tela 1000x500",20,20);
ctx.stroke();
}
I would like something easy, or something very detailed, as I'm starting to learn how to program and I do not know many tags yet.