Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

138
Vistas
Canvas Refrence point of drawing using mouse change we zoom in

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

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

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;
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda