Build turns partially transparent image pixels black

Posted by Sean O'Hollaren on Stack Overflow See other posts from Stack Overflow or by Sean O'Hollaren
Published on 2010-06-16T20:27:41Z Indexed on 2010/06/16 20:32 UTC
Read the original article Hit count: 207

Filed under:
|
|
|
|

I'm very new to C# and I've run into a problem and haven't been able to solve it. I have a row of buttons that have .png images assigned to them. The images are in .png format to allow transparency, and smoothing the edges in GIMP leaves some semi-transparent pixels. I've set the Image List Toolbar (imglToolbar)'s properties to recognize "Transparent" as the designated color to show up as transparent. I'm working in Visual Studio 2005.

The strange thing is that everything looks great when I'm viewing the Visual C# form preview window. The icons look exactly as they should. However, once I actually build the project, the buttons treat every semi-transparent pixel near the edge of the image as if it's black. It seems like it can't handle one that's both transparent and has color.

Image of it via the Visual C# form editor:

alt text

Image of what it looks like when built:

alt text

Any ideas as to why this is happening?

© Stack Overflow or respective owner

Related posts about c#

Related posts about visual-studio