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

286
Vistas
How to render "intrinsic" size of element with Dom-To-Image

I'm using tsayen's dom-to-image library to snapshot an image element. The intrinsic size of my image is close to 1000x1000px, but on my website I have it scaled down to about 500x500px. I'm wanting to scale the image back to its intrinsic size before the dom-to-image renders it. This is what I've tried to use:

HTML:

<div class="container" id="node">
   <img class="mz_img" src="/MZ.jpg" />

</div>

JS:

domtoimage
 .toPng(node, {
   style: {
    width: "1100px",
    height: "1256px",
   },
 })

This outputs an almost entirely back 1100x1256 image, with my "mz_img" image displaced almost completely out of frame. I've tried about five different ways for scaling up the image before render, and they all produce completely unpredictable (and unusable) results. What's the best method for scaling up an image before render?

about 4 years ago · Juan Pablo Isaza
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