C#: Button with transparent png overlay

thesadguy

Active Member
Joined
Nov 29, 2008
Messages
70
Reaction score
0
I have a System.Windows.Forms.Button with a BackgroundImage property set to an image (a PNG).

How can I get the transparency to work? Right now, it shows a white block. I'd like it if the white was instead transparent (and took the parent control's colour).
 
Isn't there an option to set the background color of the control to "Transparent" under the Web Colors? I haven't touched Windows Forms apps in AGES...
 
I have a System.Windows.Forms.Button with a BackgroundImage property set to an image (a PNG).

How can I get the transparency to work? Right now, it shows a white block. I'd like it if the white was instead transparent (and took the parent control's colour).

Don't think PNG's support transparency, do they? You might have to use a GIF instead.
 
Not only that, but PNG files support alpha channels, meaning that you can have an image with semi-transparent regions (i.e. 50% opacity) as well. The problem is that older browsers don't support PNGs and even newer browsers interpret the alpha channels of the images differently...

If all web browsers standardized (in Utopia perhaps?) then I would be more than happy to only use PNG files for web graphics.
 
Top
Sign up to the MyBroadband newsletter
X