PatBlt, PATINVER and HOT/HOVER display
-
I write controls and GUIs and PatBlt and PATINVERT has proved very fast and valuable when it comes to 'selecting' or hilighting something as the mouse buzzes by. In many MS products - when a mouse buzzes by the toolbar for instance, the 'hot' or highlight approach does something like 'highlight the background of the icon in blue with a blue border' but generally leaves the icon alone. I'm sure this could be implemented long hand using double buffering or simply repainting BG and then the ICON to the screen - but is there a tricky or clever way to do this - like using a MASK or something that would allow me to simply alter the background back and forth - and not need to redraw the icon (unless of course, the icon also changes to imply 'hot' or hover. Another situation might be a customer list box of some sort ... when the user highlights an item, the BG of that item changes - but the TEXT and possible ICON do not. Again, I know this can be implemented by painting everything for that item ... and made flicker free by using double buffereing ... but I'd like to investigate a more 'clever' approach - like creating a transparency by anding and oring bits and masks in just the right order. ICON Text A ICON Text B |---------------------| | ICON Text C | |---------------------| ICON Text D and that highlight could quickly follow the mouse. The technique should be valid over anything ... just as PatBlt(...PATINVERT) works so well. Unfortunately, PATINVERT inverts everything ... I need to avoid the INNERDS. Maybe start by leaving certain COLORS alone? on a PATINVERT type operation ... ? Would it be worthwhile to look into HRGNs? Many thanks in advance. -Luther