Frage

I'm adding a new entry to the main menu of the Delphi IDE (Delphi 2007) and a bmp image to the image list associated to the menu (without passing a mask as parameter)

IDEMainMenu.Images.Add(Image,nil);

but the image added is not shown with a transparent color , i tried using a 8 and 24 bits bmp and using fucsia as the background color but the ide always display the icon with the background. so the question is 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? or i need pass a mask bmp to the Images.Add function?

War es hilfreich?

Lösung

try using the icon format (.ico) instead, size 16x16 and 256 colors.

this is the code which I use, the MainMenu is the instance to the IDE menu item.

Image:=TIcon.Create;
try
 Image.Handle := LoadIcon(hInstance, sLogo16);
 ExplorerItem.ImageIndex:=MainMenu.Images.AddIcon(Image);
finally
  Image.Free;
end;

enter image description here

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top