Autor Beitrag
tartare
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89

Win XP SP2, WIN Vista Home Professional
Delphi 7/2009, C#, C++(VS 2005 Express)
BeitragVerfasst: Fr 14.04.06 20:05 
Hallo,

ich mache gerade ein Programm wo zufällig 15 Bitmaps geladen werden sollen. Ich habe vorher die Dateien und den Pfad ermittelt und in ein String array geladen aus dem die Bitmaps geladen werden sollen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
randomize;
  for i:= 1 to 15 do
  begin
  zz:=random(62)+1;
  label1.caption:=liste[zz];//Der Dateiname ist völlig in Ordnung.
  Bild[i].LoadFromFile(liste[zz]);//Aber hier gibt es immer einen EAccesViolationError
  end;


Geht das so oder wie kann man das machen?
Danke im vorraus
mfg tartare

_________________
Ich leb in meiner eigenen Welt, aber das is ok, da kennt man mich.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 14.04.06 20:21 
Hast du die Bildreferenzen vorher mit
Bild[i] := TBitmap.Create;
erzeugt? .LoadFromFile ist kein Konstruktor!

_________________
Markus Kinzler.
tartare Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89

Win XP SP2, WIN Vista Home Professional
Delphi 7/2009, C#, C++(VS 2005 Express)
BeitragVerfasst: Fr 14.04.06 20:42 
Danke, ja das war der Fehler... gut jetzt weiß ich es.

_________________
Ich leb in meiner eigenen Welt, aber das is ok, da kennt man mich.