dynamic pen (change color on fly)
Posted on 1999-07-21
Good morning everyone,
I try to find a way in MFC to change the color of a pen dynamically on fly basing on the pixels of the screen (such as hightlighting, etc). Here is my question:
Can the color of a pen be changed dynamically according to a logical function based on pixel color of the source and destination at the time the graphics is drawn?
In X window, this can be done easily by XCreateGC(...) in which one of the argument values provides a way to to logical function such as (exclusive OR) between source pixel (generated by graphics request) and destination pixel (existing pixel value-current contents of screen) to create a new pixel value (new contents of screen).
So basing on this capability, one can manupilate the logical function to produce the drawing(such as a line ) with has a desired color over a dark or a white area accordingly.
Please tell me if this can be done in MFC or direct me to any source that may help. Thank you very much.