Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

bitmap.savetostream  problems.

Posted on 2000-04-27
8
Medium Priority
?
706 Views
Last Modified: 2010-04-04
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)
0
Comment
Question by:God_Ares
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 10

Accepted Solution

by:
Lischke earned 200 total points
ID: 2758394
Hi God_Ares, I assume the first entry in your list should be a LoadFromFile. What you need to keep in mind too is to rewind your stream:

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

Ciao, Mike
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2758396
..hehe and I wrote it wrong too. The first line still should be

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

Ciao, Mike
0
 
LVL 7

Author Comment

by:God_Ares
ID: 2758398
Edited text of question.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 7

Author Comment

by:God_Ares
ID: 2758405
k i'll test it when i'm back home,  i don't have delphi @work  :(
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2758411
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
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2758413
Oops, eMail crossing :-)

Ciao, Mike
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 2760263
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!!
0
 
LVL 7

Author Comment

by:God_Ares
ID: 2763406
Lischke thank you for your awnser

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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question