Главная страница | назад





Article #15877: TImage::ReadFromStream()

 Question and Answer Database

FAQ877C.txt   TImage::ReadFromStream()
Category   :VCL
Platform    :All
Product    :C++Builder  1.x

Question:

I'm trying to use TImage::LoadFromStream() to
read from a stream that contains multiple images,
but it isn't working --- it always tries to read
the entire stream into the first image. What am I
doing wrong?

Answer:

Nothing.

TImage::LoadFromStream(Stream) will read
from the current position of the stream
to the end of the stream; there is no way,
without overriding the ReadFromStream method,
to alter this behavior.

To get around this, you need to read from the
stream which consists of multiple images into
another stream (which will consist of only
one image), and then LoadFromStream on the
second stream.

7/2/98 10:32:32 AM
 

Last Modified: 01-SEP-99