AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi TImageList gibt TImage Bild, Bild wechselt aber nicht
Thema durchsuchen
Ansicht
Themen-Optionen

TImageList gibt TImage Bild, Bild wechselt aber nicht

Ein Thema von Super_Chemiker · begonnen am 24. Mai 2009 · letzter Beitrag vom 24. Mai 2009
Antwort Antwort
Super_Chemiker

Registriert seit: 16. Nov 2008
111 Beiträge
 
Delphi 2009 Professional
 
#1

TImageList gibt TImage Bild, Bild wechselt aber nicht

  Alt 24. Mai 2009, 11:34
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
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: TImageList gibt TImage Bild, Bild wechselt aber nicht

  Alt 24. Mai 2009, 11:35
Zeig mal deinen Code
Markus Kinzler
  Mit Zitat antworten Zitat
Super_Chemiker

Registriert seit: 16. Nov 2008
111 Beiträge
 
Delphi 2009 Professional
 
#3

Re: TImageList gibt TImage Bild, Bild wechselt aber nicht

  Alt 24. Mai 2009, 11:47
Delphi-Quellcode:
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;
bzw. dasselbe mit GetImage...
  Mit Zitat antworten Zitat
Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#4

Re: TImageList gibt TImage Bild, Bild wechselt aber nicht

  Alt 24. Mai 2009, 11:49
Delphi-Quellcode:
 Image1.Picture.Bitmap := nil;
 ImageList1.GetBitmap(ImageIdx, Image1.Picture.Bitmap);
Thomas
  Mit Zitat antworten Zitat
Super_Chemiker

Registriert seit: 16. Nov 2008
111 Beiträge
 
Delphi 2009 Professional
 
#5

Re: TImageList gibt TImage Bild, Bild wechselt aber nicht

  Alt 24. Mai 2009, 11:51
Danke Herr Codelib Manager jetzt gehts!!!
Und danke auch an den Moderator!!!
An dem Problemchen knabber ich nämlich schon lange!
  Mit Zitat antworten Zitat
SimStar001

Registriert seit: 18. Jan 2008
594 Beiträge
 
#6

Re: TImageList gibt TImage Bild, Bild wechselt aber nicht

  Alt 24. Mai 2009, 11:53
Delphi-Quellcode:

var Bitmap : TBitmap;
...
  imagelist1.GetBitmap(0,Bitmap)
  image1.Picture.Assign(Bitmap);
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:16 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz