Autor Beitrag
Psyko²k
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mi 06.04.05 16:52 
Hi at all im Delphi Forum !

Seit einigen Wochen lerne ich Delphi und da habe ich euer Forum endeckt und muss sagen, es hat mir schon echt oft weiterholfen.

Nun ja, ich stehe wieder vor einem klitzkeleinen Problem

Ich habe auf meiner Form

1.) Image Komponente
und
2.) OpenPictureDialog Komponente
und natürlich ein Button

Wenn ich auf den button klicke kommt der picture dialog aber wie mache ich, das er in der Image Komponente angezeit wird ?


bin für jede Hilfe sehr Dankbar

Greetz
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mi 06.04.05 16:55 
Schau dir mal TPicture.LoadFromFile von TImage an. In der Onlinehilfe steht dazu genügend (sogar mit Beispielen)

AXMD
Popov
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1655
Erhaltene Danke: 13

WinXP Prof.
Bei Kleinigkeiten D3Pro, bei größeren Sachen D6Pro oder D7
BeitragVerfasst: Mi 06.04.05 16:56 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
  with OpenDialog1 do
    if Execute then
      if FileExists(FileName) then
        Image1.Picture.Bitmap.LoadFromFile(FileName);

_________________
Popov
Psyko²k Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mi 06.04.05 17:09 
Zitat:
with OpenDialog1 do
if Execute then
if FileExists(FileName) then
Image1.Picture.Bitmap.LoadFromFile(FileName);


danke für den code

wo muss ich ihn den einfügen ?
friesi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Windows XP SP2
VS 2005
BeitragVerfasst: Mi 06.04.05 17:45 
Du erstellst einen Button auf dem Formular. Klickst einmal doppelt drauf.
Dabei wird eine neue Prozedur erstellt.

In dieser fügst du dann den Code hinzu.

Sieht dann so aus:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Button1Click(Sender: TObject);
begin
  with OpenPictureDialog1 do
    if Execute then
      if FileExists(FileName) then
        Image1.Picture.Bitmap.LoadFromFile(FileName);
end;