![]() |
TImage wird nicht transparent dargestellt
Hallo, ich verwende auf meinem Form ein TImage, um den Status einer Verbindug grafisch darzustellen. Die Bitmaps kommen dabei aus einer TImageList und werden per Code zugewiesen.
Delphi-Quellcode:
Funktioniert auch (fast) bestens, leider wird das Image nicht transparent dargestellt. Weise ich das Bitmap zur Entwurfszeit im Objektinspektor zu und setze Transparent auf True, dann funktioniert es, nicht im anderen Fall. Was tun?
Llesy.ImgLst24x24.GetBitmap(1,Llesy.ImgStatusConnection.Picture.Bitmap);
Danke, Guido |
Re: TImage wird nicht transparent dargestellt
TransparentColor neu setzen? Nur eine Vermutung
|
Re: TImage wird nicht transparent dargestellt
hallo, das sollte man etwas anders machen:
Delphi-Quellcode:
So müssts auch funktionieren.
var
tempBmp: TBitmap; begin Imaglist.GetBitmap(index, tempBmp); tempBmp.Transparent := true; Image.Picture.Graphic.Assign(tempBmp); end; |
Re: TImage wird nicht transparent dargestellt
Zitat:
Delphi-Quellcode:
sonst gibts ne Fehlermeldung :zwinker:
tempBmp := TBitMap.Create;
ansonsten würd ich auch mal
Delphi-Quellcode:
probieren...
tempBmp.PixelFormat := pf24Bit;
Delphi-Quellcode:
[edit] ... es fehlt am schluss noch ein
var
tempBmp: TBitmap; begin tempBmp := TBitMap.Create; Imaglist.GetBitmap(index, tempBmp); tempBmp.PixelFormat := pf24Bit; tempBmp.Transparent := true; Image.Picture.Graphic.Assign(tempBmp); end;
Delphi-Quellcode:
[/edit]
tempBmp.free;
|
Re: TImage wird nicht transparent dargestellt
Hab noch mal ein wenig probiert - ohne Erfolg bisher - auch mit Bitmap.TransparentMode:=tmAuto, dann sollte die Transparente Farbe automatisch zugewiesen werden, nichts.
Habe auch schon mal Transparent auf False gesetzt, das Bitmap zugewiesen und anschließend auf True, nada. |
Re: TImage wird nicht transparent dargestellt
Hast du auch schon versucht die transparente Farbe explizit zu setzen?
|
Re: TImage wird nicht transparent dargestellt
Danke Dominik,
den Vorschlag mit dem temporären Bitmap hatte ich auch schon ausprobiert, aber das Pixelformat ist es gewesen. Es klappt! |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:34 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz