I want to write on the image using canvas but when I zoom the image mouse pointer change and it does not write in the correct place
kindly help me where I need to change that code Thanks in advance
One way you can do is that calculate the scale how much it increases with zoom in and then multiple your x and y coordinate with that scale
var rect = canvas.getBoundingClientRect(); // abs. size of element
scaleX = canvas.width / rect.width; // relationship bitmap vs. element for X
scaleY = canvas.height / rect.height; // relationship bitmap vs. element for Y
mouseX = mouseX*scaleX;
mouseY = mouseY*scaleY;