Autor Beitrag
K.haos-Prinz
Hält's aus hier
Beiträge: 12



BeitragVerfasst: Sa 14.06.08 00:39 
Moderiert von user profile iconNarses: Abgetrennt von [url=www.delphi-forum.de/...p?t=84077]hier[/url]

Hmm... ich habe momentan ein ganz ähnliches Problem. Habe so um die 100 Images (und fragt jetzt nicht warum!!!) und würde gerne Feld X ein Picture zuweisen. Um jetzt nicht mit einer case Anweisung (case X of '1' : Image1.Picture.loadfromfile ('a.bmp'); '2' : Image....) zu kommen würde ich das gerne anders regeln, weiß aber nich ganz wie. Ich glaube ich müsste hier einen Fokus einsetzen, kenne mich damit aber leider nicht aus. Kann mir jemand helfen? Am besten wäre natürlich eine Anweisung wie z.B. Image[X].Picture.loadfromfile...

Hoffe das war jetzt einigermaßen verständlich,
vielen Dank für eure Mühen!
K.hoas-Prinz
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Sa 14.06.08 00:56 
1. Neue Frage, neues Thema!
2. FindComponent()
3. Wozu hat man 100 Images?
Boldar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1555
Erhaltene Danke: 70

Win7 Enterprise 64bit, Win XP SP2
Turbo Delphi
BeitragVerfasst: Mo 16.06.08 12:55 
man kann die Images dynamisch mittels eines array of timage und einer Schleife erstellen. Dann kannst du über den index ein picure zuweisen.
wazup
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 101

Windows XP
Delphi 2009
BeitragVerfasst: Mo 16.06.08 14:36 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
var
  Images: array [0..100] of TImage;

[...]

procedure ErstelleTImage(const Datei: string);
var
  I: Integer;
begin
  for I := 0 to 100 do
  begin
    Images[I] := TImage.Create;
    Images[I].LoadFromFile(Datei);
  end;
end;


Moderiert von user profile iconChristian S.: BBCode aktiviert, sonst machen Tags keinen Sinn
platzwart
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1054
Erhaltene Danke: 78

Win 7, Ubuntu 9.10
Delphi 2007 Pro, C++, Qt
BeitragVerfasst: Mo 16.06.08 15:57 
das sind dann aber 101 Images :P
wazup
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 101

Windows XP
Delphi 2009
BeitragVerfasst: Mo 16.06.08 21:46 
Darauf kommts jetzt auch nicht mehr an :lol:
K.haos-Prinz Threadstarter
Hält's aus hier
Beiträge: 12



BeitragVerfasst: Di 17.06.08 21:47 
MUSS ich den Images dann eigentlich noch ein Parent zuweisen oder geht das auch ohne?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 17.06.08 21:54 
Moin!

user profile iconK.haos-Prinz hat folgendes geschrieben:
MUSS ich den Images dann eigentlich noch ein Parent zuweisen oder geht das auch ohne?
Wenn du möchtest, dass die Images angezeigt werden, dann wirst du wohl einen Parent zuweisen müssen. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
gfehmke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 24



BeitragVerfasst: Di 17.06.08 22:42 
Hi

u.U. wäre auch die Zuweisung einer Position hilfreich.

Zusätzlich erwägbar: Transparenz, Ereignisse . . . .

G.