Link to home
Start Free TrialLog in
Avatar of God_Ares
God_Ares

asked on

bitmap.savetostream problems.

i have a bitmap and when i do this:

bitmap.SaveToFile('c:\1\2.bmp');
Bitmap.SaveToStream(Stream);
bitmap.LoadFromStream(stream);
bitmap.SaveToFile('c:\1\3.bmp');

2.bmp <> 3.bmp   why?  What should i do to correct this?
(d5 pro)
ASKER CERTIFIED SOLUTION
Avatar of Lischke
Lischke

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lischke
Lischke

..hehe and I wrote it wrong too. The first line still should be

bitmap.LoadFromFile('c:\1\2.bmp');

Ciao, Mike
Avatar of God_Ares

ASKER

Edited text of question.
k i'll test it when i'm back home,  i don't have delphi @work  :(
And now? Will you give any comment? Even if you store the bitmap in the first line it is still needed to rewind the stream before you can read what you wrote before...

Ciao, Mike
Oops, eMail crossing :-)

Ciao, Mike
God Ares,
  I am guessing that after the SaveToStream, you need to to do a seek to set the pointer back to the beginning of the stream. For Example:


bitmap.SaveToFile('c:\1\2.bmp');
Bitmap.SaveToStream(Stream);
Stream.Seek(0,0);
bitmap.LoadFromStream(stream);
bitmap.SaveToFile('c:\1\3.bmp');


Try this and lemme know how you make out, okay?

Good luck!!
Lischke thank you for your awnser

DrDelphi thank you 2, but Lischke gave me the same...