Tutorial :.BMP Image colors being changed in winform application



Question:

I have some bitmap images being displayed in a DataGridView's and on custom controls. These are all basic lineart type images not pictures. I recently noticed that they all looked slightly faded/washed out and when I examined screenshots I took I discovered that any color channels that should have had values of 0 had a value of 44 instead. Color channels that had a value of 255 were unaffected.

The PNG images I'm using for toolbar icons are unaffected.

The problem appears to be with the ImageStream in the formname.resx file with the ImageList that dates back to when the project was created in VS2k3. There the images are displayed properly; so this appears to be a VS2k8 issue in some way shape or form.

Readding the images in 2k8 appears to fix the issue but my list is long enough to make that annoyingly time consuming. Is there anything else I could do to thump it into behaving properly?


Solution:1

Can you add the images to a Resources file (e.g. Resources.resx) or do you need to use an ImageList? Editing a Resources file is much easier than editing an ImageList, and it has the added benefit that the resources can be included at build time; that way, if your images ever change, a simple recompile will include the new ones.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »