yes, the application works fine apart from that
Code:
BackIsJPG : boolean;
LNumFrames : integer;
//write
LStream.Seek(0, 0);
LStream.Write(BackIsJPG, SizeOf(boolean));
if BackIsJPG then BackgroundJPG.SaveToStream(LStream)
else BackgroundBmp.SaveToStream(LStream);
LStream.Write(LNumFrames, SizeOf(integer));
//read
LStream.Seek(0, 0);
LStream.Read(BackIsJPG, SizeOf(boolean));
if BackIsJPG then begin
BackgroundJPG.LoadFromStream(LStream);
BackgroundBmp.Assign(BackgroundJPG);
end else BackgroundBmp.LoadFromStream(LStream);
LStream.Read(LNumFrames, SizeOf(integer));
When BackIsJPG is False it works (so writing and reading a TBitmap works) but when BackIsJPG is True the LNumFrames value is wrong as if reading the Jpeg positions the stream wrongly.
Peter
Bookmarks