Autor Beitrag
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Do 14.07.05 15:37 
Ich möchte Icons für's Menü zur Laufzeit einfügen, diese haben eine transparente Farbe clFuchsia. Wenn ich die Icons zur Designtime einfüge, ist alles in Ordnung. Die Icons werden im Menü richtig dargestellt. Wenn ich aber zur Laufzeit mittels Imagelist.Add, Imagelist.AddMasked oder was auch immer ein Bitmap einfüge, hat das keinen Effekt. Die Bereiche, die eigentlich transparent sein sollten, werden mit clFuchsia gezeichnet.
ScorpionKing
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Do 14.07.05 15:56 
Poste doch mal deinen gesamten Code, vielleicht könnten wir dir dann helfen! :wink:

Oder poste wenigstens, was du als Parameter angibst!

_________________
Aus dem Urlaub zurück!
Spaceguide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Do 14.07.05 16:45 
Nunja, ich hab schon alle möglichen Kombinationen probiert. Eine davon, die nicht funktioniert ist:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure AddMenuIcon(aItem : TTBCustomItem; const aName : string);
 var map : TBitmap;
begin
  map := TBitmap.Create;
  try

   if LoadImage(aName,map) then //returns true on success
   begin
    aItem.Images := ilMenuIcons;
    aItem.ImageIndex := ilMenuIcons.AddMasked(map,clFuchsia);
   end else aItem.ImageIndex := -1;

 finally
  map.Free;
 end;
end;
Spaceguide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Do 14.07.05 22:53 
OK, hab den Fehler selbst gefunden. Imagelists mögen wohl keine 32-Bit-Bitmaps, bei denen man das vierte Byte als Alpha-Kanal benutzt.