Autor Beitrag
kinghavi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Sa 19.08.06 13:25 
soo, ich hab mal ne Frage, ich erstelle gerade ein kleines Programm, bei dem ich mehrere Images habe, die zum anfang erstellt werden. und jedes image hat den gleichen inhalt. deswegen hatte ich mir folgendes überlgt:

fot i:= 1 to 20 do
begin
image strtoint(i).canvas....

aber leider geht das nicht, gibt es eine andere Möglicheit, also eine die funktioniert um das zu programmieren, da das pro image 5 befehle sind, und das 20 iamges sind, deswegen wären das dann ca. 100 Befehle, was natürlich speicherpaltz etc. wegnehmen würde, wie geht das anders?

danek schonmal im vorraus
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 19.08.06 13:39 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
for i := 1 to 20 do
begin
  with (FindComponent('image'+inttostr(i)) as TImage).Canvas do
  begin
    ...
  end;
end;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 19.08.06 13:41 
Noch besser wäre es die Imgages gleich in einen Array zu verfrachten.

_________________
Markus Kinzler.
kinghavi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Sa 19.08.06 13:43 
hui das ging mal schnell danke schön, klappt wunderbar!
kinghavi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Sa 19.08.06 13:57 
da ist mir jetzt gleich nen neues Problem aufgefallen! Wie kann ich Ellipsen färben, normal gibt es ja immer eine funktion, wie .color:=clred oder so, gibt es auch die Möglichkeit so ellipsen zu färben/füllen etc.

danke
NCortex
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 126

WIN 2000
D7 Enterprise
BeitragVerfasst: Sa 19.08.06 14:05 
du musst
Canvas.brush.color := clred;

setzen.

_________________
"...by all means, do not use a hammer." (aus einer IBM Technikerdokumentation ca. 1920)
--->außer es kam von Microsoft<---
kinghavi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Sa 19.08.06 14:53 
sry, aber das check ich net, bzw. funzt net, bitte ein bischen genauer! ich hab zum beispiel:

for i := 1 to 24 do
begin
with (FindComponent('image'+inttostr(i)) as TImage).Canvas do
begin
Ellipse(5,5,15,15);
Ellipse(25,5,35,15);
Ellipse(45,5,55,15);
Ellipse(65,5,75,15);
Ellipse(85,5,95,15);
end;
end;


wo muss dann das canvas.brush... hin??
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 19.08.06 14:57 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
for i := 1 to 24 do
begin
with (FindComponent('image'+inttostr(i)) as TImage).Canvas do
begin
  Brush.Color := clRed;
  Ellipse(5,5,15,15);
  Ellipse(25,5,35,15);
  Ellipse(45,5,55,15);
  Ellipse(65,5,75,15);
  Ellipse(85,5,95,15);
end;
end;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
kinghavi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Sa 19.08.06 15:19 
super denke so klappts. hatte nen canvas zu viel drin!