Autor Beitrag
Girgl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Mo 12.04.04 19:33 
Servus,
gibts ne Möglichkeit Bilder in ein Array zu laden?
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Mo 12.04.04 19:41 
ja, viele...
eine:
ausblenden Delphi-Quelltext
1:
2:
var
   imgarr: array of TImage;


raziel

_________________
JSXGraph
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Mo 12.04.04 22:03 
und wie lad ich dann ein bild aus nem bestimmten verzeichnis ein?
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 13.04.04 10:02 
Hat "TImage" nicht eine "LoadFromFile"-Methode?
Du könntest auch eine "TImageList" benutzen.

Einfach mal mutig sein und kräftig F1 drücken. ;)
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Di 13.04.04 11:43 
also eine LoadFromFile - Methode stand in der Delphi hilfe nicht und kann ich auch nich benutzen.Ich werds mal mit ImageList probieren
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Di 13.04.04 11:46 
kurze frage zu ImageLists:Kann man darin nur icons und bitmaps verwenden oder auch jpeg dateien?
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Di 13.04.04 11:55 
hab leider wieder ein problem und zwar beim laden eines bitmaps in die ImageList zeigt er an,dass das bild größer is t als die ImageList und deswegen wird das bild unverkannt hässlich dadurch,dass es so klein wird.Kann man irgendwie ändern,dass man auch größere bilder laden kann,ohne dass sich was ändert?

Edit:Ups,merke eben,dass es eine Height-Eigenschaft gibt.
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Di 13.04.04 12:18 
also das mit LoadFromFile,das is bei TPicture.Demnach hab ich jetz ein array davon erstellt.Leider gibts Probleme beim Laden.
alle Bilder sind mit i1,i2 usw. gekennzeichnet

ausblenden Delphi-Quelltext
1:
2:
3:
4:
For i:=1 to 18 do
 begin
  Images[i].LoadFromFile(ExtractFilePath(Application.ExeName)+'Bilder\Test\i'+IntToStr(i)+'.bmp');
 end;

Wie müsst ichs machen,damit ich alle der reihe nach laden kann
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Di 13.04.04 15:41 
1. Existieren die Bilder?
2. Von wo bis wo gehtn das Array? wirklich von 1-18 oder von 0-17? (wie wird das array definiert?)
3. Werden die "Created"?


raziel

_________________
JSXGraph
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Di 13.04.04 16:31 
ja,die bilder existieren.
Das Array hab ich vor dem implementierungsteil deklariert.
ausblenden Delphi-Quelltext
1:
var Images:Array[1..18] of TPicture;					


dann beim laden der einzelnen bilder ins array kommt der fehler.
Die Bilder befinden sich im Ordner 'Bilder\Test' und heissen alle durchnummeriert i1,i2,...,i18
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Di 13.04.04 19:04 
Ich hat folgendes geschrieben:
3. Werden die "Created"?


also ungefähr so (in Form.OnCreate z.B.):
ausblenden Delphi-Quelltext
1:
2:
for i := 1 to 18 do
images[i] := TPicture.Create;



raziel

_________________
JSXGraph
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Di 13.04.04 20:06 
ne,sowa shab ich nirgendswo gemacht,wieso?
Is das notwendig?
ixtreme
Gast
Erhaltene Danke: 1



BeitragVerfasst: Di 13.04.04 20:22 
ja
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Mi 14.04.04 12:53 
aber bitte nicht vergessen das ganze auch zu free'en!
im Form.onClose oder Form.OnCloseQuery ereignis:
ausblenden Delphi-Quelltext
1:
2:
for i := 1 to 18 do
   images[i].Free;



raziel

_________________
JSXGraph
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Do 15.04.04 10:54 
ok,des laden klappt jetzt,aber wie bring ich die bilder auf die form?
Ich hab versucht,ein TPIcture auf die form zu bringen und zur laufzeit dann picture das entsprechende arrayfeld zugewiesen
ausblenden Delphi-Quelltext
1:
Image1.Picture:=Images[X];					


das geht aber net.Wie kann ichs noch machen?
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Do 15.04.04 11:36 
Assign heißt das Zauberwort:
ausblenden Delphi-Quelltext
1:
Image1.Picture.Assign(Images[X]);					

nochma: Das "Free" nich vergessen!


raziel

_________________
JSXGraph
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Do 15.04.04 14:05 
ne das free hab ich scho gemacht im on-close ereignis.
Danke dir