简体   繁体   中英

Javascript canvas drawImage semi-transparent png

I'm drawing a png onto the canvas with the drawImage function. My png has semi-transparent areas, but when the image is drawn it looks like the pixels are either at 100% alpha or 0%, there's nothing inbetween. Is it possible to draw a png with an alpha value of, say 50%?

Thanks.

Yes, ignore me. It turns out my code was drawing the same sprite over and over, making the transparent parts overlay until the image was solid. You live and you learn!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM