![]() |
TImageList gibt TImage Bild, Bild wechselt aber nicht
Hallo DP,
ich habe ein Problem: Ich will einem TImage, ein Bild aus einer Imagelist zuweisen, das Bild soll aber während die Anwendung gestartet ist auf Knopfdruck wechseln. Leider funktioniert das weder mit ImageList.Draw, noch mit ImageList.GetImage Danke schonmal für eure Hilfe mfG |
Re: TImageList gibt TImage Bild, Bild wechselt aber nicht
Zeig mal deinen Code
|
Re: TImageList gibt TImage Bild, Bild wechselt aber nicht
Delphi-Quellcode:
bzw. dasselbe mit GetImage...
procedure TForm1.WurfClick(Sender: TObject);
begin randomize; W1 := random(5); W2 := random(5); if W1>W2 then begin WL.Draw(WB1.Canvas, 0, 0, W1); WL.Draw(WB2.Canvas, 0, 0, W2); end else begin WL.Draw(WB1.Canvas, 0, 0, W2); WL.Draw(WB2.Canvas, 0, 0, W1); end; Wurf.Enabled := true; end; |
Re: TImageList gibt TImage Bild, Bild wechselt aber nicht
Delphi-Quellcode:
Image1.Picture.Bitmap := nil;
ImageList1.GetBitmap(ImageIdx, Image1.Picture.Bitmap); |
Re: TImageList gibt TImage Bild, Bild wechselt aber nicht
Danke Herr Codelib Manager jetzt gehts!!!
Und danke auch an den Moderator!!! An dem Problemchen knabber ich nämlich schon lange! |
Re: TImageList gibt TImage Bild, Bild wechselt aber nicht
Delphi-Quellcode:
var Bitmap : TBitmap; ... imagelist1.GetBitmap(0,Bitmap) image1.Picture.Assign(Bitmap); |
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:03 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