Вопрос

I'm having some issues when I'm trying to delimit a area in html5 canvas, I have this img: enter image description here

I want to get transparency only in white parts of img, not on all img. I'm drawing the img in this part of code:

    this.draw = function(){
        context.save();
        context.drawImage(sniperScoop, 0, 0, w,h);      
        context.restore();
    }

That is possible using HTML 5 Canvas/Javascript ?

Thanks!

Это было полезно?

Решение

If I were you, I'd just edit the image with a program like gimp and cut out the white part. Is there any reason not to do it this way?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top