How to clear DC content?
-
Hi All.. I paint several lines in dialog using pDC->LineTo(a,b) (where: CDC *pDC = this->GetDC() ) After finish using it, I want to remove it from the screen and draw another things. How can I clear the dialog's DC? (of course, not by hide and show the dialog :) ) Thank you in advance... ps. i'm too lazy too search the boards... so, it would be ok if you have the link to the same question in this board... ^^
-Houari
-
Hi All.. I paint several lines in dialog using pDC->LineTo(a,b) (where: CDC *pDC = this->GetDC() ) After finish using it, I want to remove it from the screen and draw another things. How can I clear the dialog's DC? (of course, not by hide and show the dialog :) ) Thank you in advance... ps. i'm too lazy too search the boards... so, it would be ok if you have the link to the same question in this board... ^^
-Houari
To clear a window... Invalidate(TRUE); UpdateWindow(); ...will do it. Or using the DC, erase the background yourself using PatBlt() or whatever. Mark -- modified at 0:36 Thursday 22nd February, 2007
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."
-
To clear a window... Invalidate(TRUE); UpdateWindow(); ...will do it. Or using the DC, erase the background yourself using PatBlt() or whatever. Mark -- modified at 0:36 Thursday 22nd February, 2007
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."
Mark Salsbery wrote:
To clear a window... Invalidate(TRUE); UpdateWindow(); ...will do it.
It doesn't clear the window, is it ?
Prasad Notifier using ATL | Operator new[],delete[][^]
-
To clear a window... Invalidate(TRUE); UpdateWindow(); ...will do it. Or using the DC, erase the background yourself using PatBlt() or whatever. Mark -- modified at 0:36 Thursday 22nd February, 2007
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."
-
Mark Salsbery wrote:
To clear a window... Invalidate(TRUE); UpdateWindow(); ...will do it.
It doesn't clear the window, is it ?
Prasad Notifier using ATL | Operator new[],delete[][^]
A window that erases its background normally, yes. Transparent window no :) Also I was assuming the OP's drawing wasn't done in WM_PAINT handler. Bad assumption, bad answer :)
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."
-
It works using Invalidate and updatewindow... thanks! However, it seems that it does not work for the transparent dialog (using WS_EX_TRANSPARENT). The dialog becomes opaque if I use those function... Any idea? Thanks!
-Houari
Then you'd need to redraw (or force to be redrawn) whatever is under the window. Or whatever is under the drawing you want to erase. Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."
-
Then you'd need to redraw (or force to be redrawn) whatever is under the window. Or whatever is under the drawing you want to erase. Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."
hmm... actually I make an application to mark something on top of a media player so, the main window contains the media player activeX control, and I put transparent modeless dialog on top of it. I wonder how to redraw the player in main window... :confused:
-Houari
-
hmm... actually I make an application to mark something on top of a media player so, the main window contains the media player activeX control, and I put transparent modeless dialog on top of it. I wonder how to redraw the player in main window... :confused:
-Houari
Check out the InvalidateRect() API to mark a window or windows to be repainted. (Same API used by CWnd::Invalidate() from my original reply) Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."