德尔福切割玻璃
我正在使用 Delphi XE2,我喜欢玻璃效果,并且我想像 Windows 7 平板电脑工具中那样“切割”玻璃。 如果您也知道如何剪按钮,我会很高兴告诉我如何剪。
谢谢
I'm using Delphi XE2, and I like glass effects, and I want to "cut" glass as in Windows 7 tablet tools.
If you also know how cut a button I'll be happy if you tell me how.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在顶部区域进行绘制只需使用玻璃框架并在非客户区域进行绘制,或者使用 DwmExtendFrameIntoClientArea API。
我见过的最好的代码示例是 VCL“Ribbon”控件,它提供了一个“QAT”(快速访问工具栏)区域,绘制在“非客户区域”中。
请注意,作者不仅要考虑在打开 Glass 的 Vista/Win7 系统上如何渲染,而且还要决定在主题引擎关闭时如何在 WinXp、Win7 和 Vista 上渲染。
Vcl.Ribbon.pas
(或者如果您使用的是 XE 或更早版本,则只是 Ribbon.pas)单元中有相当多的逻辑专用于此。查看 Vcl Ribbon 源代码中的过程 TCustomRibbonQuickAccessPopupToolbar.NCPaint(DC: HDC);。
绘制从底部突出的非矩形“扩展区域”可能是应用自定义窗口剪切区域的问题。
Drawing in the top area is simply a matter of using a glass frame and painting in the non-client area, or alternatively, using the DwmExtendFrameIntoClientArea API.
The best code sample I have seen for this is the VCL "Ribbon" control, which provides a "QAT" (quick Access toolbar) area, painted in the "non client area".
Note that the author has to think not only about how to render when Vista/Win7 systems which have Glass ON, but also has to decide how to render on WinXp, Win7 and Vista when the Themes engine is off. There is quite a bit of logic in the
Vcl.Ribbon.pas
(or just Ribbon.pas if you're in XE or earlier) unit dedicated to that.Look at
procedure TCustomRibbonQuickAccessPopupToolbar.NCPaint(DC: HDC);
in the Vcl Ribbon sources.Drawing a non-rectangular "extended area" that protrudes from the bottom is probably a matter of applying a custom window clipping region.
您的意思是您想要形状吗?如果是这样,
不规则形状的表单
可能会有所帮助。我想这将在 Windows 7 上运行(请注意 Remy 在答案中的评论)。
哈
Did you mean you want shaped forms? If so
Irregularly shaped forms
could help. I imagine this will work on Windows 7 (note Remy's comment in the answer).
hth