Bitmap drawing on PalmOS can be… fun. Specially when you are trying to emulate what the real OS might be doing. Let’s see what can affect the result:
- Bitmap density: low, double.
- Bitmap depth: 1, 2, 4, 8, 16.
- Screen density: low, double.
- Screen depth: 1, 2, 4, 8, 16.
- Coordinate system: standard, double.
- Draw operation: paint, erase, mask, invert, overlay, paint inverse, swap.
Not every combination may be valid, but these alone account for a few hundred cases. Add to the mix four different bitmap versions and three different window formats. And bitmaps can have their own color table, different from the system color table. And they can have an optional transparency color index or transparency color value, depending on its version/depth. Oh, and do not forget to consider the active clipping region, if any. Did I mention there are also other high density API’s from HandEra and Sony?
As you may know, I am implementing portions of the PalmOS API on top of a modern OS. I got most of the cases described here covered, but things like BmpGetBits() and WinScreenLock() are not going to be supported for now.