在桌面上绘制而不会闪烁 [英] Draw over desktop without flickering

查看:134
本文介绍了在桌面上绘制而不会闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用鼠标手势识别器,并且在我的整个桌面上按下鼠标右键并使用铅笔工具绘图.当我释放它时,绘图仍然存在,我需要使用InvalidateRect()函数将其删除.但是它像按刷新"时一样闪烁.

有没有办法将那条线画在某个地方,但实际上不在屏幕上,这样我就可以删除它而不会产生闪烁效果?
Daniel,谢谢您!

I am working on a mouse gesture recogniser and I am pressing right click and drawing with pencil tool all over my desktop. When I release it the drawing is still there and I need to use InvalidateRect() function to remove it. But it flickers like when you press Refresh.

Is there a way to draw that line somewhere but actually not over the screen so I can delete it without having the flicker effect?
Thank you, Daniel!

推荐答案

无闪烁绘制MFC [ ^ ],也可能这些 [
Flicker Free Drawing In MFC[^] and maybe also these[^]


我看到了关于如何使用双缓冲进行绘制的一些示例,但是我可以正常绘制而不会滑动,我的问题是我需要以某种方式创建上下文的备份,并且在我绘制某些内容之后,还原旧的备份(不使用使屏幕显示在屏幕上的InvalidateRect)右键单击时,我的程序开始在所有窗口上的屏幕上绘制,而在鼠标上移时,它必须删除我绘制的所有内容,而无需使用InvalidateRect(因为该功能使我的屏幕变得平淡ck).
I saw some examples about how to draw with double buffering but i can draw normally without flicking, my problem is that i need to create a backup of the context somehow and after i draw something, to restore the old one (without using InvalidateRect which makes the screen flick. My program on right click down starts to draw on the screen over all windows and on mouse up it has to delete all what i drawed without using InvalidateRect (cause that function makes my screen flick).


这篇关于在桌面上绘制而不会闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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