Missing class members ImageList in .NETCF
The code is really simple.
FileStream strm = new FileStream(“CHMIcon.ico”, System.IO.FileMode.Open);
Bitmap bm = new Bitmap(strm);
imgList.Images.Add(bm);
This code compiled great. But when I tried to run it, I got exceptions such as not enough memory. I checked the icon file and it was around 3Kb. I googled for it and I didn’t get any straight answers. I finally decided to change the icon to jpg format instead and low and behold, everything started working perfectly.
Nobody in Microsoft told us that we cannot load icon files! Well, I tell it to you now, you cannot load ico files using this method. I wasted a couple of hours doing this before I decided to change format. An out of memory exception does not give much information and what the hell, I had my super computer resources available so there was no way it could go out of memory on an emulator. Microsoft needs to improve. Provide it in the MSDN for gods sake.