OK, this has been drving me nuts over the past few months. What I want to do
is have a bitmap (a piano keyboard) be grayed out when in a certain mode. What
I mean by grayed out it to have a checkerboard of pixels on it being the same
color as the UIFormFill. I have this working just fine on Palm OS 5 but I
can't get it working on Palm OS 3.5-4.1 as I get white instead of UIFormFill.
Can anyone help me figure this out?
Here is some code and hopefully enough comments.
// gray out keyboard
// note that keyboard is already drawn in hOffscreen before this point
WinSetDrawWindow(hOffscreenGray);
if(bInColor) {
lastForeColor = WinSetForeColor(colorIndexBlack);
lastBackColor = WinSetBackColor(colorIndexWhite);
lastTextColor = WinSetTextColor(colorIndexRed);
}
if(bROMOs35OrGreater) {
WinSetPatternType(grayPattern);
WinPaintRectangle(&rect, 0);
} else {
WinSetPattern(&checkPattern);
WinFillRectangle(&rect, 0);
}
// mask off every other pixel (checkerboard pattern)
WinCopyRectangle(hOffscreenGray, hOffscreen, &rect, 0, 0, winMask);
if(bInColor) {
IndexedColorType lbc;
// now set back color to UIFormFill
lbc = WinSetBackColor(UIColorGetTableEntryIndex(UIFormFill));
// now now make what was white to be UIFormFill (only works in OS 5)
WinCopyRectangle(hOffscreenGray, hOffscreen, &rect, 0, 0, winMask);
WinSetBackColor(lbc);
}
WinSetDrawWindow(hOffscreen);
// now continue drawing on that window (i.e. registration message).
Any help will be extremely appreciated.
Thanks,
Mike
__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/