丑陋的“残疾人"TMainMenu 的图像 [英] Ugly "disabled" images of TMainMenu

查看:20
本文介绍了丑陋的“残疾人"TMainMenu 的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Delphi 2010,Win32 VCL.我需要为我的应用程序创建一个具有最标准外观的主菜单.TMainMenu 在所有 Windows 版本中看起来都不错,唯一不好的是当它为 Enabled=False 的项目显示图像时.

Delphi 2010, Win32 VCL. I need to create a main menu for my application with the most standard look. TMainMenu looks nice in all Windows versions, the only bad thing is when it displaying images for items with Enabled=False.

Delphi 有一些奇怪的方法来构建禁用的图像(带斜角的黑白挤压,对我来说它看起来像喷溅).我想在 VCL 源代码中为该过程打一个补丁,并让菜单从同一个 TImageList 中选择禁用的图像,但我找不到它.

Delphi has some strange method for building that disabled images (b/w extrusion with bevels, for me it looks like spew). I want to make a patch for that procedure in VCL sources and let menu to select disabled images from the same TImageList, but I can't find it.

它是否存在或它是一些标准的 Windows API 调用?你知道那个程序在哪里吗?

Is it exists at all or it is some standard windows API call? Do you know where is that procedure located?

OwnerDraw 样式确实可以解决所有这些问题,但我想要更快的解决方案.

Sure OwnerDraw style can fix all this but I want a bit faster solution.

推荐答案

Galfar 的 Lair 博客 描述了该问题,并提供了解决方法的代码,覆盖了 TImageList DoDraw 方法.

There's a great post on Galfar's Lair blog which describes the problem, and has code for a workaround, overriding the TImageList DoDraw method.

这是显示之前"和之后"的图片(链接).

Here's the pic (linked) showing the 'before' and 'after'.

我认为这几乎与所有 Delphi 版本有关.

I think this relates to pretty much all Delphi versions.

这篇关于丑陋的“残疾人"TMainMenu 的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆