I wrote a small project that displays icons on the screen on WinCE. The icons are 28x28 16-color BMP files, placed in the main resource file (Resources.resx) (the resx for the main Form has the same problem, and GIF files don't work either).
The first time I try to get any bitmap from the resources, an exception of type Exception with Message "Exception" is thrown from Microsoft.AGL.Common.MISC.HandleAr, which was called from System.Drawing.Bitmap._InitFromMemoryStream.
I have two WinCE devices. This error only occurs on one of them; the other works fine. Other than this one problem, the app works on both devices. The app also uses some native code that involves DIBs, and that works fine. Any ideas?
Update: The same error occurs if I try to load a bitmap from a file. I also tried 1-bit (black & white), 8-bit and 24-bit bitmaps to no avail (WinCE framebuffers are most commonly 16-bit, but I have no image editor that can produce 16-bit bitmaps.)