Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm developing an MFC Doc/View application to display an image with functions zoom in, zoom out etc. I'm using stretchBlt in CScrollview::OnDraw While zooming out the image, the remaining view area where not repainting not getting cleared, ie part of the image of previous draws remaining as such. While doing minimize & maximize after zoomout, they becoming cleared. Also I tried to paint the view area with its background color using FillSolidRect method, then its working, but problem is it adding an annoying flicker in image display.
I tried Invalidate & UpdateWindow in functions in my Zoomout()method but it is not working.

The actual problem is while I zooming out, the StretchBlt the painting area of StretchBlt getting lesser than previous rectangle and remaining part of the view remaining unchanged.

Have method to refresh & clear the view area were not repainted?
Posted
Updated 18-Mar-14 0:34am
v3
Comments
Richard MacCutchan 18-Mar-14 5:12am    
If you invalidate the entire client area then its background should be completely erased. You then repaint with the new zoomed part of the image. Have you checked that your destination coordinates cover the entire client area?

1 solution

Calling InvalidateRect[^] (and then UpdateWindow) passing the full rectangle should be enough. To remove the flickering you should avoid updating it continually.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900