Sal*_*dor 3 delphi delphi-2007 ota
我在Delphi IDE(Delphi 2007)的主菜单中添加了一个新条目,并将bmp图像添加到与菜单关联的图像列表中(不将掩码作为参数传递)
IDEMainMenu.Images.Add(Image,nil);
Run Code Online (Sandbox Code Playgroud)
但添加的图像没有显示透明色,我尝试使用8和24位bmp并使用fucsia作为背景颜色,但ide始终显示带背景的图标.所以问题是which is the color depth of the bmp images which i must use and the color of the backgrpund to make appear the image transparent in the delphi ide menu?
或者我需要将掩码bmp传递给Images.Add
函数?
尝试使用图标格式(.ico),大小为16x16和256色.
这是我使用的代码,它MainMenu
是IDE菜单项的实例.
Image:=TIcon.Create;
try
Image.Handle := LoadIcon(hInstance, sLogo16);
ExplorerItem.ImageIndex:=MainMenu.Images.AddIcon(Image);
finally
Image.Free;
end;
Run Code Online (Sandbox Code Playgroud)