views:

68

answers:

1

I am currently drawing graphics with GDI but I need to be able to redraw the entire desktop/screen. My graphics are drawn on the screen but when I would move a plotted pixel it would become a line because I am not redrawing the screen ( well windows isn't ). I need something to force it to redraw the entire screen, I've tried the following approaches:

UpdateWindow(GetDesktopWindow() );

InvalidateRect( GetDesktopWindow(), NULL, TRUE );

SendMessage( GetDesktopWindow(), WM_PAINT, NULL, NULL );

None of them seem to work, I just need the entire screen to redraw.

A: 

The best way might be to save the previous pixel state/color and restore it when you move the pixel. Redrawing the whole screen seems like too much effort and an aweful waste of resources.

Jay
I agree with Jay... With full refresh your screen would flicker crazily!
bits
Saving every pixels position the whole time and the change would most likely make everything incredibly slow don't you think? There must be some way to force windows to redraw only a section which can be the previous position for all I care.
Yonathan Klijnsma