BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tbitmap savetostream

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
CCY
Guest





PostPosted: Sat Jun 19, 2004 3:21 am    Post subject: Tbitmap savetostream Reply with quote



I am using TBitmap to save a picture stream, then I've tried to load the
stream using TJpegImage. Will it throw any exception?


Back to top
Francesco Savastano
Guest





PostPosted: Sat Jun 19, 2004 9:12 am    Post subject: Re: Tbitmap savetostream Reply with quote



yes you cannot do that;) jpeg and bmp are completely different formats and
the headers will be immediately recogmized as different.

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"CCY" <cychia (AT) chrysanth (DOT) com> ha scritto nel messaggio
news:40d3b153 (AT) newsgroups (DOT) borland.com...
Quote:
I am using TBitmap to save a picture stream, then I've tried to load the
stream using TJpegImage. Will it throw any exception?





Back to top
Peter Below (TeamB)
Guest





PostPosted: Sat Jun 19, 2004 10:43 am    Post subject: Re: Tbitmap savetostream Reply with quote



In article <40d3b153 (AT) newsgroups (DOT) borland.com>, Ccy wrote:
Quote:
I am using TBitmap to save a picture stream, then I've tried to load the
stream using TJpegImage. Will it throw any exception?

It would have taken less time to simply try that than it took you to write
and post the message. Of course it will cause an exception, the binary
formats of bitmaps and JPEGs are quite different and there is no good way
to figure out the image format from a binary stream.


--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be



Back to top
Jens Gruschel
Guest





PostPosted: Sun Jun 20, 2004 9:48 pm    Post subject: Re: Tbitmap savetostream Reply with quote

Quote:
I am using TBitmap to save a picture stream, then I've tried to load the
stream using TJpegImage. Will it throw any exception?

Just in case you don't know:

MyJPegImage.Assign(MyBitmap)

should do what you want.

BTW: be careful with TJPegImage and LoadFromStream. If your stream contains
more than one jpeg image you will get into trouble because after
TJPegImage.LoadFromStream the stream's position is set wrong, not at the end
of the jpeg image, but a more or less random number of bytes behind that
(except if the stream contains nothing else after the image).

Jens




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.