Board index » delphi » Multiple jpgs into Binary file...

Multiple jpgs into Binary file...

Can anyone give me an example of how to take two Jpgs and store them in
a Binary file and then retrieve them and display them again??

Thanks

--
Topp

 

Re:Multiple jpgs into Binary file...


Well i will give you a short version.., you will intiate the objects your
self...
  memorystream.loadFromStream(MyJpeg);
  size := memorystream.size+filestream.Position;
  filestream.write(szie, 2); // write size of Jpeg memory used to store
file
  filestream.write(memorystread); // write the jpeg it self.
  // now repeat  all above for each Jpeg added..
--
 to read.
 Filestream(size, 2); // get size///
 memorystream.setsize(size);
 Filestream.read(memorystream.memory, size);
 Jpeg.Loadfromstread(memorystream);
 --
 if you want lets say Jpeg #2, read the first, use the

 this is just a quick example but you think you get it.
 the better way is to create a fixed index table at the start, this table
will hold the file poitner and size of
data block to where the image starts.
 use the seek to get there and then use the Block size to read data.

Quote
topprolmc wrote:
> Can anyone give me an example of how to take two Jpgs and store them in
> a Binary file and then retrieve them and display them again??

> Thanks

> --
> Topp

Other Threads