MFC视图图像显示应用程序中的刷新视图区域问题 [英] Problem on refresh view area in MFC view image display application

查看:370
本文介绍了MFC视图图像显示应用程序中的刷新视图区域问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个MFC Doc / View应用程序来显示带有放大,缩小等功能的图像。我在CScrollview :: OnDraw中使用了stretchBlt在缩小图像时,剩下的视图区域没有重新绘制被清除,即先前绘制的部分图像保持原样。在缩小后进行最小化和最大化时,它们会被清除。此外,我尝试使用FillSolidRect方法绘制具有背景颜色的视图区域,然后它的工作,但问题是它在图像显示中添加恼人的闪烁。

我在Zoomout()方法的函数中尝试了Invalidate和UpdateWindow,但它无法正常工作。



实际问题是我缩放时out,StretchBlt StretchBlt的绘画区域比前一个矩形小,并且视图的剩余部分保持不变。



有没有刷新和清除视图区域的方法没有重新绘制?

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?

推荐答案

调用 InvalidateRect [ ^ ](然后是UpdateWindow)传递完整的矩形就足够了。要消除闪烁,应避免不断更新。
Calling InvalidateRect[^] (and then UpdateWindow) passing the full rectangle should be enough. To remove the flickering you should avoid updating it continually.


这篇关于MFC视图图像显示应用程序中的刷新视图区域问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆