[英]Using UpdateLayeredWindow on a region of a window
I'm using UpdateLayeredWindow to create a layered window, and I've implemented drawing logic for the child controls.我正在使用 UpdateLayeredWindow 创建一个分层的 window,并且我已经为子控件实现了绘图逻辑。 My problem is that every time a change occurs to the uI, the whole frame needs to be redrawn.
我的问题是每次 uI 发生变化时,整个框架都需要重新绘制。 I wondered if there was a way to only redraw a specific CRect or CRgn of the window (ie, passing the relevant CDC into UpdateLayeredWindow, but specifying the CRect you want to be invlidated).
我想知道是否有一种方法可以只重绘 window 的特定 CRect 或 CRgn(即,将相关的 CDC 传递到 UpdateLayeredWindow,但指定要被激活的 CRect)。
Would using UpdateLayeredWindowIndirect, and setting the prcDirty CRect in the UPDATELAYEREDWINDOWINFO struct, to the client area of the control, cause an update of only that area?使用 UpdateLayeredWindowIndirect 并将 UPDATELAYEREDWINDOWINFO 结构中的 prcDirty CRect 设置为控件的客户区域,是否会导致仅更新该区域?
The psize
and pptSrc
parameters let you specify what portion of the window you want to update. psize
和pptSrc
参数让您指定要更新 window 的哪一部分。 UpdateLayeredWindow
does not use an invalidation model. It uses an update model. UpdateLayeredWindow
不使用失效 model。它使用更新 model。
"UpdateLayeredWindow always updates the entire window. To update part of a window, use the traditional WM_PAINT and set the blend value using SetLayeredWindowAttributes." “UpdateLayeredWindow 始终更新整个 window。要更新 window 的一部分,请使用传统的 WM_PAINT 并使用 SetLayeredWindowAttributes 设置混合值。” - http://msdn.microsoft.com/en-us/library/windows/desktop/ms633556(v=vs.85).aspx
- http://msdn.microsoft.com/en-us/library/windows/desktop/ms633556(v=vs.85).aspx
Please read the docs.请阅读文档。 Pleeeeease.
请放心。
Would using UpdateLayeredWindowIndirect, and setting the prcDirty CRect in the UPDATELAYEREDWINDOWINFO struct, to the client area of the control, cause an update of only that area?
使用 UpdateLayeredWindowIndirect 并将 UPDATELAYEREDWINDOWINFO 结构中的 prcDirty CRect 设置为控件的客户区域,是否会导致仅更新该区域?
Yes.是的。 This is exactly what it does.
这正是它的作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.