Delphi IDE (239)
Windows with Delphi (38)
About this site
Links to us
Streaming out multiple pictures (any raw data)
This article has not been rated yet. After reading, feel free to leave comments and rate it.
// After streaming out 2 jpegs, the second one cannot be read
ms := TMemoryStream.Create;
// now it is at the end of the stream
// and JPG2 won't be read
Store the length of each graphic (raw data blob) before the data.
Use this value when reading from the stream.
You don't like the formatting? Check out SourceCoder then!
procedure SavePicture(Stream: TStream; gr: TGraphic);
P := Stream.Position;
newp := Stream.Position;
Stream.Position := P;
P := newp-P-sizeof(P);
Stream.Position := newp;
procedure LoadPicture(Stream: TStream; gr: TGraphic);
v : integer;
MemStream := TMemoryStream.Create;
MemStream.Position := 0;