Autor Beitrag
Dede
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 21

Win 2000, Suse Linux 8.0
D6 Ent
BeitragVerfasst: Mi 25.08.04 20:53 
Hi

Mein Problem ist derzeit dieses:
Ich möchte ein Bild binär speichern (in einer Datei oder ähnlichem), weis aber nicht wie ich das machen kann. Dieses Bild möchte ich später natürlich auch wieder anzeigen.

Sinn der Sache:
Ich möchte das der Benutzer Bilder für bestimmte Sachen auswählen kann und natürlich auch neue hinzufügen kann und ich keine Lust habe einen Ordner mit zig tausend Bildern zu haben.

Schonmal Danke für die Antworten

Gruss
Dede
MartinPb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 698



BeitragVerfasst: Mi 25.08.04 21:20 
Wenn du Bitmap hast:

ausblenden Delphi-Quelltext
1:
Bitmap.SaveToFile('c:\pfad\date.bmp');					


Wenn du ein Image hast:

ausblenden Delphi-Quelltext
1:
Image.Picture.Bitmap.SaveToFile('c:\pfad\date.bmp');					

_________________
Gruß
Martin
Dede Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 21

Win 2000, Suse Linux 8.0
D6 Ent
BeitragVerfasst: Mi 25.08.04 22:01 
Nein, das ist nicht was ich meine.
Ich möchte mehrere Bilder in einer Datei speichern. (Im Prinzip eine typsierte Datei mit vielen Bildern)
.Chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1112



BeitragVerfasst: Mi 25.08.04 22:11 
Da ein Bitmap im Grunde genommen nichts weiter ist als ein Bytearray (die genaue Umwandlung überlasse ich deiner Phantasie), stellt das Ganze kein großes Problem dar. Du legst dir eine Datei an. Die ersten 4 Byte geben die Größe des ersten Bildes an. Danach speicherst du das Bytearray. Die darauffolgenden 4 Byte geben die Größe des zweiten Bildes, danach folgt das zweite Array, usw. Wahlweise machst du das Ganze noch mit Inhaltsverzeichnis, damit du nicht immer alles auslesen musst.

Das ist wie immer _ein_ Lösungsansatz.

Gruß,
Jörg
Matthias
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 121



BeitragVerfasst: Mi 25.08.04 23:55 
Hallo,

Das Bitmapobjekt stellt alles notwendige zur Verfügung. Verwende die Methoden SaveToStream bzw LoadFromStream. Das heißt als erstest erzeugtst Du einen File Stream. Danach kannt Du alle notwendigen Informationen dort hinein schreiben. Du soltest Dir in diesem Zusammenhang außerdem Gedanken über den Aufbau des Streams (der Datei) machen (Header u.s.w).

ciao

Matthias
Dede Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 21

Win 2000, Suse Linux 8.0
D6 Ent
BeitragVerfasst: Do 26.08.04 17:02 
Ah ja, wunderbar, das hilft mir
Dankeschön