windows - 在win32中更改无边框窗口的颜色
问题描述
我正在创建一个无边框窗口,类似于https://github.com/melak47/BorderlessWindow并使用它来创建交换链并使用 vulkan 绘制到其中。
为了获得无边框窗口(带有航空阴影),我使用: DwmExtendFrameIntoClientArea 最多 1 个像素。我可以用我的交换链在最后一个像素边框上绘制。经过一番谷歌搜索后,我明白这是唯一的方法。
不幸的是,在调整大小时,无论我如何与合成器同步,我仍然偶尔会看到明亮的白色边框闪烁。
为了使这一点可以接受,我想为边框使用更中性的颜色。我如何实现这一目标?
编辑:如果我将边框增加到 10 像素,我会得到:( 绿色和红色框由 vulkan 绘制,没有透明度,框架被清除为零的 alpha)
这个白色是哪里来的?
注意:这不是强调色。
解决方案
I found the solution.
There is an undocumented function to set additional DWM settings of a window: https://gist.github.com/ysc3839/b08d2bff1c7dacde529bed1d37e85ccf
This is also used to make blurred transparency and can change the border color with the ACCENT_ENABLE_GRADIENT enum.
推荐阅读
- performance-testing - 用户网络速度对 Web 服务器性能有影响吗?
- python - 如何使用 Beautiful Soup 从 html 页面中找到每个链接作为字符串?( findAll 功能不适用于该网站)
- react-native - 视图在 React Native iOS 上无缘无故地颤抖
- c++ - 使用 XOR 逻辑查找丢失的数字
- embedded - 如何在不更新整个固件的情况下使嵌入式系统可配置
- apollo-client - Apollo-client 状态管理缓存在保存和删除操作后不会自动更新
- kotlin - micronaut 数据和复合键映射
- c++ - 如何让两个进程完成一个任务,谁先完成任务,再终止另一个
- r - 使用相同的名称和数字后缀动态重命名所有列
- python - 使用循环创建数组(Python)