Overlay Z-Orders (Windows CE 5.0)

本文讨论了在WindowsCE5.0环境下,如何使用DirectDraw功能来合理设置OVERLAY程序的堆叠顺序,解决多个OVERLAY程序相互遮挡的问题。通过调用IDirectDrawSurface5::UpdateOverlayZOrder方法调整OVERLAY的Z顺序,可以确保特定程序始终处于最顶层,避免被其他程序覆盖。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文地址::http://msdn.microsoft.com/en-us/library/ms924178.aspx


相关网帖

1.Windows CE, directdraw display driver - overlay z order----http://www.mofeel.net/1020-microsoft-public-windowsce-embedded/7762.aspx

2.development, DirectDraw Blt and AlphaBlt are really slow -----http://www.mofeel.net/1019-microsoft-public-windowsce-app-development/5851.aspx

3.Windows CE, How to handle with IDirectDrawSurface::UpdateOverlayZOrder in----http://www.mofeel.net/1020-microsoft-public-windowsce-embedded/640.aspx

4.DDRAWI_DIRECTDRAW_GBL (Windows CE 5.0)----http://msdn.microsoft.com/en-us/library/ms898266.aspx

5.RE: UpdateOverlayZOrder failure----http://www.tech-archive.net/Archive/WindowsCE/microsoft.public.windowsce.embedded/2008-12/msg00069.html



Windows CE 5.0
This topic has not yet been rated Rate this topic
Send Feedback

Overlay surfaces are assumed to be on top of all other screen elements, but when you display multiple overlay surfaces, you need some way to visually organize them.

DirectDraw supports overlay z-ordering to manage the order in which overlays clip each other. Z-order values represent conceptual distances from the primary surface toward the viewer.

They range from 0, which is just on top of the primary surface, to 4 billion, which is as close to the viewer as possible, and no two overlays can share the same z-order.

You set z-order values by calling the IDirectDrawSurface5::UpdateOverlayZOrder method.

Destination color keys are affected only by the bits on the primary surface, not by overlays occluded by other overlays. Source color keys work on an overlay whether or not a z-order was specified for the overlay.

Overlays without a specified z-order are assumed to have a z-order of 0. Overlays that do not have a specified z-order behave in unpredictable ways when overlaying the same area on the primary surface.

A DirectDraw object does not track the z-orders of overlays displayed by other applications.

Note   You can ensure proper clipping of multiple overlay surfaces by calling  UpdateOverlayZOrder in response to WM_KILLFOCUS messages.
When you receive this message, set your overlay surface to the rearmost z-order position by calling the  UpdateOverlayZOrdermethod with the dwFlags parameter set to DDOVERZ_SENDTOBACK.


//=============================================
备注::
1>今天也遇到这样的问题,多个OVERLAY程序,有的OVERLAY程序老是会被盖住的情况,不知道这篇文章中讲的方法是不是可行,明天试一下看看,希望可性!!!



### 修改 `el-overlay` 的 `z-index` 属性 在使用 Element Plus 或 Element UI 时,修改特定组件的样式(如 `z-index`),可以通过自定义 CSS 来实现。由于框架中的样式可能具有较高的优先级,因此需要采取一些特殊的方式来覆盖默认样式。 #### 方法一:通过 `:deep()` 调整嵌套样式 如果项目中启用了 scoped CSS,则可以直接利用 Vue 提供的 `:deep()` 功能来穿透作用域并调整子组件的样式: ```css /* 假设当前组件有 unique-class */ .unique-class :deep(.el-overlay) { z-index: 9999 !important; } ``` 上述代码的作用是仅针对带有 `.unique-class` 的父容器内的 `.el-overlay` 设置新的 `z-index` 值,并强制生效[^2]。 --- #### 方法二:全局覆盖样式 如果不希望局限于某个具体页面或组件范围,可以在项目的全局样式文件(如 `style.css` 或 `index.scss`)中直接写入以下规则: ```css .el-overlay { z-index: 9999 !important; } ``` 这种方式会直接影响到整个应用中所有的 `.el-overlay` 元素,适用于统一调整的情况[^1]。 --- #### 方法三:动态绑定内联样式 对于某些场景下无法通过静态方式完全控制样式的场合,也可以借助 JavaScript 动态设置样式: ```javascript const overlayElement = document.querySelector('.el-overlay'); if (overlayElement) { overlayElement.style.zIndex = '9999'; } ``` 此方法适合于运行时根据条件动态改变样式的需求[^3]。 --- #### 注意事项 当尝试修改由第三方库渲染的内容时,需要注意这些 DOM 结构可能是动态生成的,甚至可能会因为版本差异而有所不同。例如,在调试过程中发现实际类名并非预期值时,应仔细核对 HTML 输出结构以及对应的文档说明。 此外,为了避免不必要的副作用,建议尽可能缩小样式的影响范围,比如采用唯一标识符或者限定上下文的方式。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值