Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have a shapy image that I got to set as backgroundimage of the form. I also got to add components to the form. I can't get rid of the transparent shade - that appears as it is in the form even after using BackColor and TransparentKey is not being of best help.

I found Tranparency Tutorial with C#[^] helpful. Even if I drag my image to it, it shows perfectly well. I was trying hard to implement the same in my form, but couldn't do it. If I inherit my form from PerPixelAlphaForm
class or add Win32 class to my Form class, I could't have access to the designer nor it works also.

I also tried with adding a panel to the form and setting image to the panel and work on it. That improves the image's transparency but doesn't get the best results as Transparency Tutorial shows.

How do I implement it to make work on my Form i.e. set my form's backgroundImage using UpdateLayeredWindow ?? Kindly try to help me out. I have been trying to accomplish this from last 2 days, but have been failed so far.

Looking forward for your help. Any help is highly appreciated.

Thanks
Posted
Updated 29-Jul-11 1:39am
v2

1 solution

The only thing I can suggest is that your png image wasn't saved in such a way as to have a transparency color/attribute.
 
Share this answer
 
Comments
All Time Programming 29-Jul-11 7:36am    
@John, the PNG has transparency colors. If it wouldn't be supportive then in Transparency tutorial project, it wouldn't show me the shapeful image. Even in an Image editor I see the image with transparent colors.

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