Thanks for the suggestion. I'll take a look at that. One thought I had was to load the bitmap from the resources using the ID, then do a pixel by pixel scan and replace transparent-colored pixels with the background color. I was hoping there might be some little known system function that would do something like that for me.
Thanks again, jcc "Matt Hebley" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > If you grub around in the OS source code long enough, you can find code to > invert coloured text, maybe the table code. It makes several calls to > WinPaintRectangle, IIRC. It might work on graphics. > > Matt > > ----- Original Message ----- > From: "John Cramer" <[EMAIL PROTECTED]> > Newsgroups: palm-dev-forum > To: "Palm Developer Forum" <[EMAIL PROTECTED]> > Sent: Friday, March 28, 2003 1:33 PM > Subject: Draw highlights for selected icon > > > > I recently implemented the 5-way navigation on the Tungsten-W on an app > that > > has a view similar to the Launcher (home screen) showing a bunch of icons. > > I'm looking for a good way to highlight the icons that have selection > focus > > similar to the way they are highlighted in the Launcher screen. > > > > I first tried WinInvertRectangle, but the selection color was black > (inverse > > of white) and images on the color screen didn't look very good. > > > > I next tried using WinSetBackColor/WinSetForeColor with > > UIObjectSelectedForeground and UIObjectSelectedFill to give the icon the > > right selection background color, but the picture part of the image still > > didn't look very good (all the white was replaced by the background color > > and the black text part of the image didn't invert to white). > > > > Finally, I created two sets of images for unselected and selected and used > > CtlGlueGetGraphics and CtlSetGraphics to swap the unselected and selected > > images, and that worked fine but doubled the size of the program due to > the > > additional images. > > > > The Launcher page seems to be able to highlight the icons in that screen > > without having two sets of images, and does a pretty good job of it. I > > looked for some way to toggle the "drawnAsSelected" flag in the > > ControlAttrType structure, but there doesn't seem to be a helper function > > for it and I understand that direct access wouldn't be allowed in PalmOS > 5, > > so I didn't pursue it. > > > > Does anyone have any suggestions on a better way to do this? I'd really > > appreciate any help. > > > > Thanks, > > jcc > > > > > > > > -- > > For information on using the Palm Developer Forums, or to unsubscribe, > please see http://www.palmos.com/dev/support/forums/ > > > > > > > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
