问题描述
你如何使用 来吸引你的松鼠:
所以,归结为——DwmGetColorizationColor 是完全无法用于尝试的应用程序将当前颜色应用到不透明的表面.
另见
- 是否有列表GetThemeColor/Visual Styles API 的有效参数组合
- Windows 如何改变 Aero Glass 的颜色?
- DWM - 使用 DWMGetColorizationColor 的着色颜色处理
- 检索用于不透明表面渲染的 Aero Glass 基色
我想问这个问题已经一年多了.我一直都知道这是不可能回答的,让任何人真正关注的唯一方法就是拥有彩色屏幕截图;开发人员被闪亮的东西所吸引.但不利的一面是,这意味着我不得不投入各种工作来制作诱饵.
Colorization color != 选择的基色.这是误导,我知道.
但是我很困惑.您借用的图片来自我的帖子,标题为检索用于不透明表面渲染的 Aero Glass 基色".这不是你想做的吗?我还在帖子中指出了存储所有颜色信息的注册表位置 (HKEY_CURRENT_USERSoftwareMicrosoftWindowsDWM) 以供检索.
8 月 26 日编辑
DwmGetColorizationColor (dwmapi.dll) 返回着色颜色",它是各种颜色(包括您选择的基色)和着色器逻辑的混合,以实现整体玻璃效果.
您需要/想要的所有颜色信息都可以在上述注册表项中找到.基色、混合使用的颜色以及最终的着色颜色都在那里.
(上述密钥存在于 Windows Vista 及更高版本上.)
How do you use DwmGetColorizationColor
?
The documentation says it returns two values:
- a 32-bit
0xAARRGGBB
containing the color used for glass composition - a boolean parameter that is true "if the color is an opaque blend" (whatever that means)
Here's a color that i like, a nice puke green:
You can notice the color is greeny, and the translucent title bar (against a white background) shows the snot color very clearly:
i try to get the color from Windows:
DwmGetColorizationColor(dwCcolorization, bIsOpaqueBlend);
And i get
dwColorization: 0x0D0A0F04
bIsOpaqueBlend: false
According to the documentation this value is of the format AARRGGBB
, and so contains:
AA: 0x0D (13)
RR: 0x0A (10)
GG: 0x0F (15)
BB: 0x04 (4)
This supposedly means that the color is (10, 15, 4), with an opacity of ~5.1%.
But if you actually look at this RGB value, it's nowhere near my desired snot green. Here is
- (10, 15, 4) with zero opacity (the original color), and
- (10,15,4) with 5% opacity against a white/checkerboard background:
Rather than being Lime
green, DwmGetColorizationColor
returns an almost fully transparent black.
So the question is: How to get glass color in Windows Vista/7?
i tried using DwmGetColorizationColor
, but that doesn't work very well.
A person with same problem, but a nicer shiny picture to attract you squirrels:
i love this guy's screenshots much better than mine. Using his screenshots as a template, i made up a few more sparklies:
For the last two screenshots, the alpha blended chip is a true partially transparent PNG, blending to your browser's background. Cool! (i'm such a geek)
Edit 2: Had to arrange them in rainbow color. (i'm such a geek)
Edit 3: Well now i of course have to add Yellow.
Undocumented/Unsupported/Fragile Workarounds
There is an undocumented export from DwmApi.dll
at entry point 137, which we'll call DwmGetColorizationParameters
:
HRESULT GetColorizationParameters_Undocumented(out DWMCOLORIZATIONPARAMS params);
struct DWMCOLORIZATIONPARAMS
{
public UInt32 ColorizationColor;
public UInt32 ColorizationAfterglow;
public UInt32 ColorizationColorBalance;
public UInt32 ColorizationAfterglowBalance;
public UInt32 ColorizationBlurBalance;
public UInt32 ColorizationGlassReflectionIntensity;
public UInt32 ColorizationOpaqueBlend;
}
We're interested in the first parameter: ColorizationColor
.
We can also read the value out of the registry:
HKEY_CURRENT_USERSoftwareMicrosoftWindowsDWM
ColorizationColor: REG_DWORD = 0x6614A600
So you pick your poison of creating appcompat issues. You can
- rely on an undocumented API (which is bad, bad, bad, and can go away at any time)
- use an undocumented registry key (which is also bad, and can go away at any time)
See also
- Is there a list of valid parameter combinations for GetThemeColor / Visual Styles API
- How does Windows change Aero Glass color?
- DWM - Colorization Color Handling Using DWMGetColorizationColor
- Retrieving Aero Glass base color for opaque surface rendering
i've been wanting to ask this question for over a year now. i always knew that it's impossible to answer, and that the only way to get anyone to actually pay attention is to have colorful screenshots; developers are attracted to shiny things. But on the downside it means i had to put all kinds of work into making the lures.
Colorization color != the base color chosen. It's misleading, I know.
But I'm confused. The image you borrowed was from my post entitled "Retrieving Aero Glass base color for opaque surface rendering". Is this not what you want to do? I also indicated in the post the registry location in which all the color information is stored (HKEY_CURRENT_USERSoftwareMicrosoftWindowsDWM) for retrieval purposes.
Edited 8/26
DwmGetColorizationColor (dwmapi.dll) returns the "colorization color", which is a blend of various colors (incl. your selected base color) and shader logic to achieve the overall glass effect.
All the color information you need/want can be found in the registry key noted above. The base color, the colors used in blending, and the resulting colorization color are all there.
(The key above is present on Windows Vista and above.)
这篇关于Vista/7:如何获得玻璃颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!