views:

70

answers:

1

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?

+1  A: 

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.

CodeSavvyGeek
I probably can because I think direct access to the ImageList is well encapsulated. I've never accessed anything from Resources.resx from code (vs the properties page in the designer) before. Is there anything I need to be aware of?
Dan Neely
If you use the Visual Studio designer to edit the resources file, it will generate a typesafe class structure for you to use in your code (e.g. `Bitmap b = Properties.Resources.Image1;`).
CodeSavvyGeek