Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
HTML2Canvas png compensaciones de color de divs

Estoy codificando una especie de visualizador de interfaz de usuario para un juego, y quiero que la interfaz de usuario se descargue al hacer clic en un botón, estoy usando html2canvas para eso. El problema es que muestra algunas grandes compensaciones en la imagen cuando se descarga.

Resultado:

resultado

Esperado: (sin el fondo, no importa).

esperado

Aquí está mi código:

 function DOWNLOAD() { var container = document.getElementById("DrawBox");; /* full page */ window.scrollTo(0, 0); html2canvas(container, { allowTaint: true, }).then(function(canvas) { var link = document.createElement("a"); document.body.appendChild(link); link.download = "html_image.jpg"; link.href = canvas.toDataURL(); console.log(container) link.target = '_blank'; link.click(); }); }

Código de cuadro de dibujo CSS (es un div en mi código);

 .drawBox { position: absolute; box - sizing: content - box; width: 100 % ; height: 500 px; margin - top: 20 px; width: 800 px; box - shadow: 0 0 6 px hsl(200 deg 100 % 80 % ); margin - left: 200 px; text - shadow: 0 0 7 px hsl(200 deg 100 % 80 % ); background - color: rgb(25, 63, 83, 0.1); opacity: 1; transition: 1 s; }

Todos los divs creados se colocan en drawBox. ¡Gracias por adelantado!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!