Click here to Skip to main content
15,919,778 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionusing lib Pin
kcynic15-Jul-07 12:46
kcynic15-Jul-07 12:46 
AnswerRe: using lib Pin
DevMentor.org17-Jul-07 7:11
DevMentor.org17-Jul-07 7:11 
Questionvector Pin
dellthinker15-Jul-07 12:34
dellthinker15-Jul-07 12:34 
AnswerRe: vector Pin
Axter15-Jul-07 17:08
professionalAxter15-Jul-07 17:08 
AnswerRe: vector Pin
Stephen Hewitt15-Jul-07 19:09
Stephen Hewitt15-Jul-07 19:09 
QuestionRe: vector Pin
David Crow16-Jul-07 4:28
David Crow16-Jul-07 4:28 
QuestionR2_NOTXORPEN drawing mode question Pin
perrin486915-Jul-07 11:22
perrin486915-Jul-07 11:22 
AnswerRe: R2_NOTXORPEN drawing mode question Pin
Mark Salsbery15-Jul-07 13:02
Mark Salsbery15-Jul-07 13:02 
Perrin01 wrote:
the R2_NOTXORPEN mode makes it so the element is redrawn white


Not necessarily. The resulting color depends on the color of your pen and the color of the
screen pixel it's being combined with.

Here's how they get combined (from the docs):

R2_XORPEN Pixel is a combination of the colors in the pen and in the screen, but not in both.
R2_NOTXORPEN Pixel is the inverse of the R2_XORPEN color.


These are bitwise logical XOR and NOT combinations that are applied to the RGB components of the
pixel colors (the docs don't exacly state that Smile | :) ).

For each red, green, and blue pixel byte, when combining colors, if you use a pen color RGB
(0xFF,0xFF,0xFF) with R2_NOTXORPEN:

Every bit gets flipped (XOR)
Every bit gets flipped again (NOT)
Result is the original pixel so you don't see any change

If you use a pen color RGB(0x00,0x00,0x00) with R2_NOTXORPEN:

No bits get flipped (XOR)
Every bit gets flipped (NOT)
Result is binary inverse of the original pixel

Hope that helps a little.

Mark




Mark Salsbery
Microsoft MVP - Visual C++


"Great job team! Head back to base for debriefing and cocktails."

GeneralRe: R2_NOTXORPEN drawing mode question Pin
perrin486915-Jul-07 13:48
perrin486915-Jul-07 13:48 
GeneralRe: R2_NOTXORPEN drawing mode question Pin
Mark Salsbery15-Jul-07 13:52
Mark Salsbery15-Jul-07 13:52 
GeneralRe: R2_NOTXORPEN drawing mode question Pin
perrin486915-Jul-07 14:07
perrin486915-Jul-07 14:07 
GeneralRe: R2_NOTXORPEN drawing mode question [modified] Pin
Mark Salsbery15-Jul-07 14:12
Mark Salsbery15-Jul-07 14:12 
GeneralRe: R2_NOTXORPEN drawing mode question Pin
perrin486915-Jul-07 14:28
perrin486915-Jul-07 14:28 
QuestionBringing MFC app to web - which technology horse to ride? Pin
Mike A. Jones15-Jul-07 10:15
Mike A. Jones15-Jul-07 10:15 
AnswerRe: Bringing MFC app to web - which technology horse to ride? Pin
Mark Salsbery15-Jul-07 11:21
Mark Salsbery15-Jul-07 11:21 
AnswerRe: Bringing MFC app to web - which technology horse to ride? Pin
jhwurmbach16-Jul-07 0:00
jhwurmbach16-Jul-07 0:00 
Questiondifferent %f for variables in a string Pin
Dane Grant15-Jul-07 9:20
Dane Grant15-Jul-07 9:20 
QuestionRe: different %f for variables in a string Pin
Mark Salsbery15-Jul-07 9:30
Mark Salsbery15-Jul-07 9:30 
AnswerRe: different %f for variables in a string Pin
Dane Grant15-Jul-07 9:35
Dane Grant15-Jul-07 9:35 
GeneralRe: different %f for variables in a string Pin
Mark Salsbery15-Jul-07 9:45
Mark Salsbery15-Jul-07 9:45 
GeneralRe: different %f for variables in a string Pin
David Crow16-Jul-07 4:30
David Crow16-Jul-07 4:30 
Questionplotting in real time Pin
Sam Rens15-Jul-07 8:50
Sam Rens15-Jul-07 8:50 
QuestionRe: plotting in real time Pin
Mark Salsbery15-Jul-07 9:35
Mark Salsbery15-Jul-07 9:35 
AnswerRe: plotting in real time Pin
Sam Rens15-Jul-07 9:43
Sam Rens15-Jul-07 9:43 
GeneralRe: plotting in real time Pin
Mark Salsbery15-Jul-07 9:51
Mark Salsbery15-Jul-07 9:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.