Autor Beitrag
mick
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 159



BeitragVerfasst: Sa 19.12.09 13:32 
hallo zusammen -

folgendes problem:

ich habe ein kleines image, in das eine art vorschaubild eines jpg-bildes geladen wird. soweit, so gut. wenn der user nun jedoch auf dieses image draufklickt, soll sich screen-mittig ein neues formular oeffnen, das groessentechnisch angepasst an die originalgroesse des jpg-bildes ein image enthaelt, das wiederum das jpg-bild enthaelt - eben in originalgroesse. groesse des images und des formulars muessen also dynamisch an die jpg-bildgroesse, welche auszulesen ist, angepasst und screenmittig platziert werden.
damit scheine ich z.z. ueberfordert. :-) wer vermag mir mit code zu helfen?

beste gruesse,
mick.
Niko S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: Sa 19.12.09 14:09 
Kann man voraussetzen, dass du bereits neue Formulare erstellen kannst?
Wenn ja:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
begin
  Form2.Show;
  // Attribute, die man auch im Objectinspektor setzen kann
  Form2.AutoSize := True;
  Form2.Image1.AutoSize := True;
  Form2.Image1.Top := 0;
  Form2.Image1.Left := 0;
  Form2.Image1.Picture.LoadFromFile('C:\irgendeine.datei.jpg');
  Form2.Left := (Screen.Width div 2) - (Form2.Width div 2);
  Form2.Top := (Screen.Height div 2) - (Form2.Height div 2);
end;
mick Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 159



BeitragVerfasst: Sa 19.12.09 18:25 
danke, habe es nun folgendermassen geloest:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
  { Einstellungen zu Formular FormBild und dem dazugehoerigen Image vornehmen }
  FormBild.AutoSize := True;
  FormBild.Position:= poScreenCenter;
  FormBild.ImgBildOriginalgroesse.AutoSize := True;
  FormBild.ImgBildOriginalgroesse.Top := 0;
  FormBild.ImgBildOriginalgroesse.Left := 0;
  FormBild.ImgBildOriginalgroesse.Picture := ImgBild.Picture;
  { Bildformular aufrufen }
  FormBild.ShowModal;


ciao,
mick.