Click here to Skip to main content
16,015,072 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Subject: Flickering (A problem for EVER) Pin
Hadi Rezaee27-May-02 6:36
Hadi Rezaee27-May-02 6:36 
GeneralRe: Subject: Flickering (A problem for EVER) Pin
Hadi Rezaee27-May-02 7:59
Hadi Rezaee27-May-02 7:59 
GeneralRe: Subject: Flickering (A problem for EVER) Pin
Alan Chambers27-May-02 6:06
Alan Chambers27-May-02 6:06 
GeneralRe: Subject: Flickering (A problem for EVER) Pin
Hadi Rezaee27-May-02 6:35
Hadi Rezaee27-May-02 6:35 
GeneralRe: Subject: Flickering (A problem for EVER) Pin
Hadi Rezaee27-May-02 8:01
Hadi Rezaee27-May-02 8:01 
GeneralRe: Subject: Flickering (A problem for EVER) Pin
Alan Chambers27-May-02 9:20
Alan Chambers27-May-02 9:20 
GeneralRe: Subject: Flickering (A problem for EVER) Pin
Hadi Rezaee27-May-02 9:26
Hadi Rezaee27-May-02 9:26 
GeneralRe: Subject: Flickering (A problem for EVER) Pin
Alan Chambers27-May-02 10:02
Alan Chambers27-May-02 10:02 
Right, ok, I have an idea, but since I've never done this it will remain an idea till it gets proven one way or the other. I know there is an event OnMouseMove(UINT flags, CPoint pos) that processes the WM_MOUSEMOVE message and is triggered when you move the mouse - obviously. You can test if the left mouse button is being held down by checking the flags for MK_LBUTTON. The event will give you the (x,y) coordinates of the mouse in a CPoint structure to which you can draw the card (whether these (x,y) coordinates represent the top left, middle, bottom right of the card is up to you - I know you know all this so far, but its just for the benefit of others who may want to do it). Now heres the good part, you need to create a memory DC to work with. Without this you WILL get flickering from a screen that is getting regularly drawn to. Something like this MAY work (I'm very rusty on this Smile | :) ):

CDC dcMem;
dcMem.CreateCompatibleDC(GetDC());

OK so you have a background DC (similar to the DirectDraw backbuffer), select your background bitmap into ANOTHER DC (not screen) and blit to the memDC(start afresh) with SRCCOPY flag. Then select your card bitmap into the extra DC and blit it again with but this time to the (x,y) coordinate of the memory DC. Finally blit the memory DC to the screen and you should find it keeps redrawing the card image as you move the mouse (providing your custom tests are met). I'm not sure how fast or smooth this solution is likely to be, but I'd like to know (if it works or not at all too).

Alan.

"When I left you I was but the learner, now I am the master" - Darth Vader
GeneralCalling Windiff within my program Pin
Gilfrog27-May-02 5:00
Gilfrog27-May-02 5:00 
GeneralRe: Calling Windiff within my program Pin
Martin Ziacek27-May-02 5:54
Martin Ziacek27-May-02 5:54 
GeneralRe: Calling Windiff within my program Pin
Gilfrog27-May-02 6:26
Gilfrog27-May-02 6:26 
GeneralRe: Calling Windiff within my program Pin
Martin Ziacek27-May-02 7:41
Martin Ziacek27-May-02 7:41 
GeneralRe: Calling Windiff within my program Pin
Gilfrog27-May-02 8:08
Gilfrog27-May-02 8:08 
GeneralRe: Calling Windiff within my program Pin
Martin Ziacek27-May-02 8:25
Martin Ziacek27-May-02 8:25 
GeneralRe: Calling Windiff within my program Pin
Gilfrog27-May-02 8:44
Gilfrog27-May-02 8:44 
GeneralRe: Calling Windiff within my program Pin
Mike Nordell27-May-02 21:03
Mike Nordell27-May-02 21:03 
GeneralSetting System Time and Date Pin
Mark Donkers27-May-02 4:50
Mark Donkers27-May-02 4:50 
GeneralRe: Setting System Time and Date Pin
Mark Donkers27-May-02 4:59
Mark Donkers27-May-02 4:59 
Generalunresolved external problems (again...sigh) Pin
Alan Chambers27-May-02 4:44
Alan Chambers27-May-02 4:44 
GeneralRe: unresolved external problems (again...sigh) Pin
Orbital^27-May-02 4:53
Orbital^27-May-02 4:53 
GeneralRe: unresolved external problems (again...sigh) Pin
Alan Chambers27-May-02 5:35
Alan Chambers27-May-02 5:35 
GeneralRe: unresolved external problems (again...sigh) Pin
SamirSood27-May-02 5:29
SamirSood27-May-02 5:29 
GeneralRe: unresolved external problems (again...sigh) Pin
Alan Chambers27-May-02 5:48
Alan Chambers27-May-02 5:48 
GeneralRe: unresolved external problems (again...sigh) Pin
Erik Funkenbusch27-May-02 5:27
Erik Funkenbusch27-May-02 5:27 
GeneralRe: unresolved external problems (again...sigh) Pin
Alan Chambers27-May-02 5:57
Alan Chambers27-May-02 5:57 

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.