Click here to Skip to main content
16,009,407 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: start button Pin
Prakash Nadar13-Mar-04 22:36
Prakash Nadar13-Mar-04 22:36 
GeneralRe: start button Pin
Michael P Butler13-Mar-04 22:23
Michael P Butler13-Mar-04 22:23 
GeneralRe: start button Pin
gonenb16-Mar-04 21:02
gonenb16-Mar-04 21:02 
GeneralRe: Console Application Pin
Branislav13-Mar-04 3:48
Branislav13-Mar-04 3:48 
QuestionHow do I Dynamically Draw Lines with the Mouse Pin
Anonymous12-Mar-04 18:57
Anonymous12-Mar-04 18:57 
AnswerRe: How do I Dynamically Draw Lines with the Mouse Pin
Prakash Nadar12-Mar-04 19:46
Prakash Nadar12-Mar-04 19:46 
GeneralRe: How do I Dynamically Draw Lines with the Mouse Pin
Anonymous13-Mar-04 19:45
Anonymous13-Mar-04 19:45 
AnswerRe: How do I Dynamically Draw Lines with the Mouse Pin
Christopher Lloyd13-Mar-04 8:08
Christopher Lloyd13-Mar-04 8:08 
An easy solution is to use an XOR pen. When you draw your line it'll be XORed with whatever is already on the screen. When the mouse moves draw the previous line again using the XORed pen (this will remove the previous line) and then draw the new line, again using the XORed pen.
This works because XOR is it's own inverse.
To actually code this you'll need to use the api function SetROP2 before drawing. This determines how GDI merges pens (and some other drawing objects too) with what's already on the screen.
The only disadvantge is that an XOR pen isn't a solid colour, rather it appears as the inverse of the colour on the screen. Of course, this might actually be a good thing as it ensures your line is always visible no matter what you draw over.
Hope that helps.
GeneralCALLBACK Pin
Shi Zhu12-Mar-04 18:01
Shi Zhu12-Mar-04 18:01 
GeneralRe: CALLBACK Pin
l a u r e n12-Mar-04 20:21
l a u r e n12-Mar-04 20:21 
GeneralRe: CALLBACK Pin
Prakash Nadar12-Mar-04 22:29
Prakash Nadar12-Mar-04 22:29 
GeneralRe: CALLBACK Pin
Rickard Andersson2012-Mar-04 23:49
Rickard Andersson2012-Mar-04 23:49 
GeneralRe: CALLBACK Pin
Prakash Nadar13-Mar-04 1:54
Prakash Nadar13-Mar-04 1:54 
GeneralRe: CALLBACK Pin
Prakash Nadar13-Mar-04 3:19
Prakash Nadar13-Mar-04 3:19 
GeneralRe: CALLBACK Pin
Rickard Andersson2013-Mar-04 5:30
Rickard Andersson2013-Mar-04 5:30 
GeneralRe: CALLBACK Pin
Prakash Nadar13-Mar-04 5:51
Prakash Nadar13-Mar-04 5:51 
GeneralRe: CALLBACK Pin
Rickard Andersson2013-Mar-04 5:58
Rickard Andersson2013-Mar-04 5:58 
GeneralRe: CALLBACK Pin
Prakash Nadar13-Mar-04 14:11
Prakash Nadar13-Mar-04 14:11 
GeneralRe: CALLBACK Pin
Rickard Andersson2013-Mar-04 14:17
Rickard Andersson2013-Mar-04 14:17 
GeneralRe: CALLBACK Pin
Shi Zhu13-Mar-04 1:15
Shi Zhu13-Mar-04 1:15 
GeneralRe: CALLBACK Pin
Gary R. Wheeler13-Mar-04 5:45
Gary R. Wheeler13-Mar-04 5:45 
GeneralRe: CALLBACK Pin
Shi Zhu13-Mar-04 15:07
Shi Zhu13-Mar-04 15:07 
GeneralCFormView MDI App. Pin
nimrodel12-Mar-04 17:41
nimrodel12-Mar-04 17:41 
GeneralRe: CFormView MDI App. Pin
Antti Keskinen13-Mar-04 23:05
Antti Keskinen13-Mar-04 23:05 
GeneralRe: CFormView MDI App. Pin
nimrodel14-Mar-04 21:39
nimrodel14-Mar-04 21:39 

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.