Drawing PNG to a canvas element — not showing transparency

前端 未结 5 1143
耶瑟儿~
耶瑟儿~ 2020-12-16 10:24

I\'m trying to use drawImage to draw a semi-transparent PNG on a canvas element. However, it draws the image as completely opaque. When I look at the resource that\'s being

5条回答
  •  萌比男神i
    2020-12-16 10:58

    It ought to work fine, are you sure your image is really transparent and not just white in the background?

    Here's an example of drawing a transparent PNG over a black rectangle to base your code off of:

    http://jsfiddle.net/5P2Ms/

提交回复
热议问题