Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

159
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda