[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3168
  • Last Modified:

How to draw a tranparent png image at Canvas?


I need to draw a PNG image on Canvas. Now I'm saving the image as a BMP and tranparent drawing works. But some PNG images have parts (like shadows on image) that merges with background. in PhotoImpact, I fill the backgroung with some color and the shadow become a real shadow, meging with background color. but on BMPs this don't happen. The mask color become transparent, but shadow part don't.

I need draw the PNG image on Canvas respecting the PNG instructions of transparency, like shadows need to work.

One example of an PNG of my example can be downloaded at: http://entropymine.com/jason/testbed/pngtrans/rgba8_bk.png

1 Solution
you will need a png component that supports transparency. I never tried transparent png's but here are is a free library that is pretty good (dunno about transparency, though they mention some support of it):
alijuniorAuthor Commented:

That was exactly what I need. I search but not found it before...

Thanks a lot!

Best regards.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now