Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我正在为我的中期项目使用 MFC SDI 应用程序。但每次我绘制场景(使用 GDI)和“invalidate()”时,它都会发生闪烁。
我使用 DWM 进行双重缓冲和消除闪烁,但它很少发生。我认为问题在于垂直同步。我可以做些什么来启用虚拟同步
尝试覆盖OnEraseBkgnd并简单地返回TRUE并且什么都不做。这将防止每次绘制时“擦除”背景。返回TRUE时说“我已经删除了它”,即使你没有做过这样的事情。
OnEraseBkgnd
TRUE