Autor Beitrag
knuffel
ontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 68

WIN XP Prof
D3 Prof, D7 Ent
BeitragVerfasst: Do 21.08.03 14:32 
Hi! :?

Wie kann ich es machen, dass eine sichtbare Komponente, in meinem Fall ein image zur Laufzeit erstmal auf dem Formular platziert wird ??

danke, knuffel

_________________
Carpe Diem. Also programmier mit Delphi.
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Do 21.08.03 15:59 
Hi,

2 möglichkeiten ;)

a) Das Image zur Entwurfszeit plazieren und einfach Visible:=false einstellen. dann erst zur Runtime sichtbar machen.

b) so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
var
  Img: TImage;
begin
  Img:=TImage.Create(self);
  Img.Parent:=self;
  Img.Width:=50;
  Img.Height:=50;
  Img.Picture.LoadFromFile(...);


Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Do 21.08.03 17:11 
Und nicht vergessen:
ausblenden Quelltext
1:
Img.Free;					


Gell Aya! ;)

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Do 21.08.03 17:12 
Hi,
Motzi hat folgendes geschrieben:
Und nicht vergessen:
ausblenden Quelltext
1:
Img.Free;					


Gell Aya! ;)

'türlich... nur was würde ein Bild bringen welches auf Knopfdruck erstellt wird, für ne nanosekunde sichtbar is und dann wieder weg is? *gg*

Aber gut, ich hätte ihn darauf hinweisen können *pfeift*

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Do 21.08.03 17:22 
Aya hat folgendes geschrieben:
für ne nanosekunde sichtbar is

Nichtmal die..! ;)

Zitat:
Aber gut, ich hätte ihn darauf hinweisen können *pfeift*

Jaja..! ;)

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 21.08.03 19:58 
Free ist nicht nötih, da bei Create die üvbergeordnete Komponente angegeben worde. Das heißt wenn diese zerstört wird, zerstört diese automatisch die untergerodnete Komponente mit. Hätte man nan dieser Stelle nil angegeben, wäre es sinvoll bei Beendigung des Programmes Free aufzurufen, aber nicht unbedingt ntig, da nach Beendigung des Programmes Windows automatisch wieder der komplette Adresseraum des Prozesses zur Verfügung steht. Windows weiß, wann der Prozess beendet wurde und keinen 'Speicher mehr braucht. Steht so im Richter.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Fr 22.08.03 08:13 
@Luckie: das stimmt schon, aber ich finde es ist trotzdem guter Programmierstil seine selbst erzeugten Objekte auch wieder selbst freizugeben...! (vor allem bei Objekten wie Streams, StringLists etc. gibt es keinen Owner der die für dich freigibt!)

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 22.08.03 11:48 
Sicher, aber, wenn man sicn angewöhnt bei sowas den Owner anzugeben, dann muß man sich später nicht mehr drumkümmern. Desweiteren:
ausblenden Delphi-Quelltext
1:
2:
var 
  Img: TImage;

Wenn das lokal ist, wie willst du das ihn OnClose wieder freigeben? Du müßtest es dazu global machen.