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

161
Vistas
Is there a way to make a rectangular area 0 alpha (transparent) after it has been drawn on to?

I've seen lots of questions asking how to draw a semi-transparent rectangle or other shape onto canvas after it's already been drawn to. My problem is that I want a rectangular area to be 0 alpha, but it seems to draw just nothing on top of what is there. I understand why that is (you are drawing 0 alpha on top of something that is already drawn), but I want those pixels 0 alpha. There has to be way.

Basically, I want to define an area that has 0 alpha after the canvas has already something drawn to it.

function fillPreviewClearColor(x,y)
{
    ctx2.beginPath();
    ctx2.rect(x, y, 10, 10);
    ctx2.fillStyle = "rgba(255, 255, 255, 0.0)"; // I want NOTHING here
    ctx2.fill();    
    ctx2.restore();
}
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