简体   繁体   English

在 window 的区域上使用 UpdateLayeredWindow

[英]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. psizepptSrc参数让您指定要更新 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.

相关问题 Winapi:如何使用 UpdateLayeredWindow 在窗口上显示屏幕截图 - Winapi: How to display screenshot on window using UpdateLayeredWindow 使用UpdateLayeredWindow将部分透明的GDI +位图绘制到无边界窗口 - Drawing a partially transparent GDI+ Bitmap to a borderless window using UpdateLayeredWindow 分层窗口,UpdateLayeredWindow和性能 - Layered windows, UpdateLayeredWindow and performance Windows API:UpdateLayeredWindow返回值 - Windows API: UpdateLayeredWindow return values 如何正确移动带有区域的窗口? - How do I properly move a window with a region? 在窗口中绘画之前是否需要使更新区域无效 - Is it necessary to invalidate update region before painting in the window UpdateLayeredWindow,SIZE_RESTORED和GetClientRect问题 - UpdateLayeredWindow, SIZE_RESTORED and GetClientRect problem 如何从图像中提取ROI区域并在窗口中显示它 - How to extract ROI region from an image and show it in a window 如何使用grabWindow截取窗口的特定区域的屏幕截图? - How to use grabWindow to take a screenshot of only a certain region of a window? 获取确切的窗口区域大小-CreateWindow窗口大小不是正确的窗口大小 - Get exact window region size - CreateWindow window size isn't correct size of window
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM