Erase previous drawings
-
Hi I have got the following code: Code: drawDATA(Shapes shapes, CDC& cd){ // select pen ... ect // draw shapes cd.TextOut(X, Y, "DRAW1"); } I am calling drawDATA from two methods drawA, drawB with: CClientDC dc(this) as parameter. drawA(shapesA, dc); --> if user invokes action A Invalidate() drawB(shapesB, dc); --> if user invokes action B Invalidate(); both methods draw the shapes, but I only want to show the latest shapes not both shapes of A and B. If user clicks button A then i should show him shapes A If he clicks Button B then I should show him shapes B. If he clicks A , I should show shapes A first, and he continues and clicks B, I should erase shapes A and show shapes B only SO iI need a way of erasing previous shapes thank
llp00na
-
Hi I have got the following code: Code: drawDATA(Shapes shapes, CDC& cd){ // select pen ... ect // draw shapes cd.TextOut(X, Y, "DRAW1"); } I am calling drawDATA from two methods drawA, drawB with: CClientDC dc(this) as parameter. drawA(shapesA, dc); --> if user invokes action A Invalidate() drawB(shapesB, dc); --> if user invokes action B Invalidate(); both methods draw the shapes, but I only want to show the latest shapes not both shapes of A and B. If user clicks button A then i should show him shapes A If he clicks Button B then I should show him shapes B. If he clicks A , I should show shapes A first, and he continues and clicks B, I should erase shapes A and show shapes B only SO iI need a way of erasing previous shapes thank
llp00na
Invalidate() doesn't redraw your window, it merely tells your window that the whole thing needs to be redrawn the next time the WM_PAINT message is handled. if you want to erase the background, just fill it with the background color.
-
Invalidate() doesn't redraw your window, it merely tells your window that the whole thing needs to be redrawn the next time the WM_PAINT message is handled. if you want to erase the background, just fill it with the background color.
-
Hi I have got the following code: Code: drawDATA(Shapes shapes, CDC& cd){ // select pen ... ect // draw shapes cd.TextOut(X, Y, "DRAW1"); } I am calling drawDATA from two methods drawA, drawB with: CClientDC dc(this) as parameter. drawA(shapesA, dc); --> if user invokes action A Invalidate() drawB(shapesB, dc); --> if user invokes action B Invalidate(); both methods draw the shapes, but I only want to show the latest shapes not both shapes of A and B. If user clicks button A then i should show him shapes A If he clicks Button B then I should show him shapes B. If he clicks A , I should show shapes A first, and he continues and clicks B, I should erase shapes A and show shapes B only SO iI need a way of erasing previous shapes thank
llp00na
Try RedrawWindow[^] instead of Invalidate...
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
I am drawing on top of a web browser control So cant use the background colour I tried UpdateWindow() but does not work
llp00na
UpdateWindow just sends the WM_PAINT message to your app, it doesn't actually cause painting to happen. basically painting happens whenever your app has nothing else to do and your app gets around to processing the WM_PAINT message. that's not going to happen in the middle of a function (unless you're doing something like an old-school Message Pump between statements). but, basically, there is no "erase" functionality. there is only draw. if you need to erase drawing A, you have to draw what was there before you drew A.
-
Try RedrawWindow[^] instead of Invalidate...
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
Are you using
IWebBrowser2
?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Are you using
IWebBrowser2
?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Can you call it's
Refresh()
orRefresh2()
method?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Can you call it's
Refresh()
orRefresh2()
method?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
I have tried Refresh() But it erases everything, even those created after Refresh is called drawShapesA Refresh() drawShapesB
llp00na
Are you changing the HTML that the
IWebBrowser2
control is rendering?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Are you changing the HTML that the
IWebBrowser2
control is rendering?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
I am drawing on top of a web browser control So cant use the background colour I tried UpdateWindow() but does not work
llp00na
llp00na wrote:
I am drawing on top of a web browser control
Which means that anytime the Web browser control redraws itself, anything drawn on top of it goes away.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons