![]() |
Speedbutton + Canvas
hi
Ich weis dieses Theme hatten wir schon :mrgreen: Ich hab den Code von ![]() Wenn ich nun folgendes mache,
Delphi-Quellcode:
bleibt der Speedbutton trotzdem so grau wie vorher :gruebel:
var bmp: TBitmap;
begin try bmp := TBitmap.Create; bmp.Width := SpeedButton1.Width -4; bmp.Height := SpeedButton1.Height -4; bmp.Canvas.Pen.Color := clgreen; bmp.Canvas.FillRect(Rect(0, 0, bmp.Width, bmp.Height)); SpeedButton1.Glyph.Assign(bmp); finally bmp.Free; end; Was mache ich falsch? |
Re: Speedbutton + Canvas
keine ahnung wieso, aber bei mir gehts nur mit Rect(1, 1, bmp.Width, bmp.Height)
und natürlich brush.color statt pen.color
Delphi-Quellcode:
bmp := TBitmap.Create;
try bmp.Width := SpeedButton1.Width -4; bmp.Height := SpeedButton1.Height -4; bmp.Canvas.Brush.Color := clgreen; bmp.Canvas.FillRect(Rect(1, 1, bmp.Width, bmp.Height)); SpeedButton1.Glyph.Assign(bmp); finally bmp.Free; end; |
Re: Speedbutton + Canvas
Moin!
Wenns mit 1, 1 geht, dann ist vermutlich die Transparenz Schuld, weil im Auto Modus wird der linke unterste Pixel als Transparenzfarbe genutzt und meiner Meinung nach steht in der Hilfe zu Glyph beim SpeedButton irgendwas zur Transparenz... MfG Muetze1 |
Re: Speedbutton + Canvas
Danke!
Das ist zwar eine Lösung aber optisch fängt das Bild leider nicht ganz oben links an. :? Naja ich versuche daran noch ein wenig herum zu spielen... |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:24 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 by Thomas Breitkreuz