为什么Delphi 2010 TRibbon可以控制“闪烁”?在 Windows XP 上,但不在 Vista/7 上?

发布于 2024-09-25 09:37:17 字数 471 浏览 3 评论 0原文

alt text

我注意到,当我使用 Delphi 2010 附带的 TRibbon 控件时,它在我的 Windows 7 系统上完美运行。然而,该应用程序在具有“经典主题”(我还没有尝试过 playschool 主题)的 Windows XP 系统上存在一些奇怪的绘画问题。

我知道还有其他功能区组件可从 DevExpressTMS 软件,但是购买第 3 方控件不是此项目的选择。

有谁遇到过这个问题,或者知道解决方案吗?

alt text

I've noticed that when I use TRibbon control that comes with Delphi 2010, it works flawlessly on my Windows 7 system. However, the application has some weird painting issues on a Windows XP system with the "classic theme" (I haven't tried the playschool theme).

I know there are other Ribbon components available from DevExpress and TMS Software, however purchasing a 3rd party control is not an option for this project.

Has anyone had this issue, or know of a solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

悲歌长辞 2024-10-02 09:37:17

很可能是因为 Windows 7 使用“桌面合成”,这本质上意味着将组件绘制到屏幕外位图,然后复制到显示器上。在 XP 中,组件通常直接在显示器上绘制(如果组件首先擦除那里的内容并在“干净的石板上”进行绘制,则可能会导致闪烁)。

Delphi 支持双缓冲,它可以完成同样的事情。如果将功能区的 DoubleBuffered 属性设置为 True(在代码中,因为它未发布),那么应该可以避免闪烁(以分配额外的内存并在绘图时移动为代价)——但是,我应该说,我还没有实际上用 TRibbon 尝试过。

请注意,如果将 DoubleBuffered 设置为 True,则在 Windows 7(或 Vista)上运行时不会产生额外开销。 VCL 的代码可以在执行桌面合成的 Windows 版本上运行时跳过屏幕外位图业务。

Most likely because Windows 7 uses "Desktop Compositing", which essentially means that a component is drawn to an off-screen bitmap and then copied onto the display. In XP, a component typically draws directly onto the display (which can cause flicker if the component first erases what's there and draws over the "clean slate").

Delphi supports double-buffering, which accomplishes the same thing. If you set the ribbon's DoubleBuffered property to True (in code, since it's not published) then that should avoid the flicker (at the cost of extra memory allocated and moved around when drawing)--I should say, however, that I haven't actually tried it with TRibbon.

Note that there is no additional overhead when running on Windows 7 (or Vista, for that matter) if you set DoubleBuffered to True. The VCL has code the skips the off-screen bitmap business when running on a version of Windows that does desktop compositing.

画▽骨i 2024-10-02 09:37:17

这很可能是 TRibbon 代码中的错误,Microsoft 功能区在 XP 和 Win7 中都呈现完美。

如果您更改 XP 主题,图像中显示的最小化按钮是否会发生变化以反映您的主题更改?如果是这种情况,则 Ribbon 代码可能已针对 Vista 和 7 进行了优化,并且未开发为在 XP 下完美运行。

除非您可以修改 TRibbon 代码,否则您无法真正解决它。

Most likely this is a bug in the TRibbon code, the Microsoft ribbon renders perfect in both XP and Win7.

If you change your XP theme does the Minimise button shown in the image change to reflect your theme change? If this is the case the Ribbon code has probably been optimised for Vista and 7 and not been developed to run perfectly under XP.

You cant really resolve it unless you can modify the TRibbon code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文