Flicker problem with Gradient background when resizing.

Hi to all.
I am coding on Windows XP,VC++,OCC6.3.
I have got the way to gradient background,using myView->SetWindow(aWNTWindow, 0, (&COCCView::CallBack), this) mathod.But the background is flickering when resized the window.I have solve the flickering problem when use flat background though the mathod posted on thread http://www.opencascade.org/org/forum/thread_8291/.But the method does not work when use any gradient background.And I have tried other methods to display a gradient background,such as Sexy Background posted on the thread http://www.opencascade.org/org/forum/thread_16172/ .
So does any body has solved the flicker problem with Gradient background when resizing?I need your help.
Thanks!

Pawel's picture

Hi fietiger,

I use the 'callback method' to render the gradient background. After applying the mentioned patch it works just fine. Maybe you enforce redrawing in your code?

Pawel

fietiger's picture

Thank you for your reply.I tried the 'callback method'with the mentioned patch,and deleted almost all myView->Redraw() calls,that is only one call of myView->Redraw() was left.But the viewer is still flickering when resizing. What is more wired is that when flat background is used the object such as the bottle is flickering when resizing.There is something must be incorrect.
Here is some code.

void COCCView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);

// TODO: Add your message handler code here
if (!myView.IsNull())
{
myView->MustBeResized();
}
}
And is there someother code could enforce redrawing when resize the view?
Thank you again.

fietiger's picture

Yes,You are right.I have two OCC pathes.I did not notice that the one I applied patch is not the real inuse one.There is no flickering problem any more.But I have some problem with 'callback'method.I will get to check the reasonable.
Thank you.