Click here to Skip to main content
15,884,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want my PNG pic to be moved with cursor (yeah that's success) but when i move on sth (pic,....) it showed the backcolor of my PNG image so it hide object. What i have to do with this?
Posted
Comments
UJimbo 2-Nov-11 3:45am    
Can you please elaborate? Do you want your picture to become transparent while you move it around with the cursor, so that you can see the objects underneath?
lukeer 2-Nov-11 5:15am    
He wants the background of the moving image to be transparent.
I'm not sure whether PNG supports an alpha channel?
hzawary 2-Nov-11 5:32am    
I'm sure that PNG supported Alpha channel!

1 solution

The moving image's background colour can be a solid white. That will look like it was transparent when moving over a white area.

If you want to preserve the transparent look on any area, your moving image's background colour needs to be truly transparent. Besides the channels for (R)ed, (G)reen and (B)lue, there should be an (A)lpha channel. Set the alpha of all background pixels to zero and you have a transparent background.

If you create the images within your program, you can do this in code. If you use external images, use an image manipulation program (Paint.NET, GIMP, ...) instead.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900