 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
CCY Guest
|
Posted: Sat Jun 19, 2004 3:21 am Post subject: Tbitmap savetostream |
|
|
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
|
Posted: Sat Jun 19, 2004 9:12 am Post subject: Re: Tbitmap savetostream |
|
|
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
|
Posted: Sat Jun 19, 2004 10:43 am Post subject: Re: Tbitmap savetostream |
|
|
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
|
Posted: Sun Jun 20, 2004 9:48 pm Post subject: Re: Tbitmap savetostream |
|
|
| 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 |
|
 |
|
|
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
|
|