ADC Home > Reference Library > Technical Q&As > Legacy Documents > Graphics & Imaging >
Important: The information in this document is Not Recommended and should not be used for new development.
Current information on this Reference Library topic can be found here:
|
Q: In our application, the user can select an area of an
image and drag it around. I want to show this visually by inverting the region
under the current mouse coordinate as the user moves the mouse around.
Inverting the region is nice because I can invert it again to get the
unselected pixels back. It's not nice, however, in that a 50% gray color looks
the same when it's inverted. To fix this problem, I tried using A: You get the results you want on direct devices but not on indexed ones, and unless you're extremely lucky with your color table, this is how it will always work. The problem is that the mode calculations are done with the actual RGB values used (the ones available in the color table), not the ones you request. On indexed devices there's almost always a difference between the two, so unless your color table happens to have the exact color you request, there will be "errors." This never happens on direct devices because all colors are available - the operations work on direct RGB values and are never mapped through color tables. The solution is either to set up your color tables or palettes to make sure you get the results you want each time, or to install a custom color search procedure if that's what you'd prefer. |
|