Autor Beitrag
Lars88
Hält's aus hier
Beiträge: 14



BeitragVerfasst: Mo 13.06.05 14:04 
Hi,

ich habe mir ein Zeichenprogramm programmiert und möchte jetzt eine Funktion zum Speichern bzw. Öffnen erstellen. Jedoch hab ich keine Ahnung wie man sowas macht. Gibt es da vorgefertigte Methoden oder ist das Hard-Core-Programming :?

Wäre schön wenn ihr mir mal Tipps geben könntet wie ihr sowas macht.
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mo 13.06.05 14:05 
Dazu müsste man schon etwas mehr über dein Programm wissen. ;) Wie zeichnest du denn? ;)
Tilo
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1098
Erhaltene Danke: 13

Win7 geg. WInXP oder sogar Win98
Rad2007
BeitragVerfasst: Mo 13.06.05 14:12 
Siehe Komponente TImageBox, Eigenschaft picture -> Safetofile, bzw Loadfromfile

Das hast Du doch gesucht?
LH_Freak
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 385

Win XP
D7 PE, D2k5 Trial
BeitragVerfasst: Mo 13.06.05 14:40 
user profile iconTilo hat folgendes geschrieben:
Siehe Komponente TImageBox, Eigenschaft picture -> Safetofile, bzw Loadfromfile

Das hast Du doch gesucht?


saVetofile ;)
Lars88 Threadstarter
Hält's aus hier
Beiträge: 14



BeitragVerfasst: Mo 13.06.05 14:43 
Ich zeichne einfach über die Canvas befehle auf die Form.

Eine Komponente TImageBox habe ich nicht. Ist das eine Custom-Komponente die ich erst installieren muss. Ich habe Delphi 7
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 13.06.05 14:57 
Da du sowieso auf ein Bitmap im Speicher zeichnen solltest, benutz doch die Methode SaveToFile von TBitmap.
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 28

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mo 13.06.05 15:02 
wenn du das formular nämlich bewegst oder es überdeckt wird, verschwindet dein bild wieder :)
Lars88 Threadstarter
Hält's aus hier
Beiträge: 14



BeitragVerfasst: Mo 13.06.05 15:13 
Ja, genau dazu hab ich noch ne Frage in dem Thread: www.delphi-forum.de/....php?p=262575#262575

Hab das nämlich noch nicht ganz verstanden gehabt mit der Bitmap...
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mo 13.06.05 17:05 
Du speicherst ganz einfach so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if SaveDialog1.Execute then try
Leinwand.GetFormImage.SaveToFile(SaveDialog1.FileName);
except
ShowMessage('Fehler beim Speichern.');
end;
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 28

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mo 13.06.05 17:07 
nimm doch einfach ein image, male mit image1.canvas und speichere mit image1.picture.savetofile und das problem ist gelöst :!:
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mo 13.06.05 17:08 
user profile iconF34r0fTh3D4rk hat folgendes geschrieben:
nimm doch einfach ein image, male mit image1.canvas und speichere mit image1.picture.savetofile und das problem ist gelöst :!:

Wenn er aber auf Leinwand (TForm) zeichnet, dann muss er's aber so machen. :tongue: Und so geht's auch. :mrgreen:
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 28

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Mo 13.06.05 17:13 
sollte er aber nicht, denn das formular ist dafür 100% ungeeignet :idea:
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 13.06.05 17:50 
Und ein TImage noch ungeeigneter, denn es wurde dazu entwickelt fertige Grafiken anzuzeigen. Zum selber mal gibt es die TPaintbox.
Lars88 Threadstarter
Hält's aus hier
Beiträge: 14



BeitragVerfasst: Mo 13.06.05 18:13 
Und wie mache ich aus der Paintbox ne Bitmap? Da muss ich doch dann Paintbox.TBitmap.Create; oder sowas machen???
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 13.06.05 18:20 
Guck in den Thread zu deiner anderen Frage. In em Artikel habe ich zum Schluss ein beispiel, wie es geht.