Assembly turns partially transparent image pixels

I am very new to C # and I ran into a problem and couldn't solve it. I have a number of buttons that are assigned .png images. Images are in .png format to provide transparency, and smoothing edges in GIMP leaves some translucent pixels. I set the properties of the Image List toolbar (imglToolbar) to recognize "Transparent" as the designated color, to appear as transparent. I work in Visual Studio 2005.

It is strange that everything looks great when I look at the preview window of a Visual C # form. The icons look exactly as they should. However, as soon as I actually create the project, the buttons process each translucent pixel near the edge of the image, as if it were black. It seems like it cannot handle one that is transparent and has color.

Image of this file using the Visual C # Form Editor:

alt text http://img5.imageshack.us/img5/2577/whatiwanted.jpg

Image of what it looks like when building:

alt text http://img690.imageshack.us/img690/7241/whatigot.jpg

Any ideas as to why this is happening?

+4
source share
2 answers

I just found the answer, at least in my specific situation.

The form I'm dealing with is a top-level MDI container. For some reason, if the icons set to 32-bit color do not correctly interpret these translucent pixels. Installing it on a 24-bit, on a whim, completely solved the problem. I'm not sure that this is some kind of situation that arose as a result of some invisible factor, but changing the color depth fixed my problem.

Also for those who may come here with a similar problem, make sure that the window is not a child of the MDI container. When searching for information, I found that MDI children do not support TransparencyKeys at all.

+2
source

I ran into this problem; changing the IsMdiContainer property to a false solution.

+1
source

Source: https://habr.com/ru/post/1313024/


All Articles