CFbsBitmap storing to stream

Login to reply to this topic.
Thu, 2005-08-04 10:28
Joined: 2005-06-09
Forum posts: 8
Hello

If I use method CFbsBitmap::Save(filename), It work's corectly.

But I need store CFbsBitmap to stream (stream is open to file) so i open stream

RWriteStream::Create(RFS, filename, iFlags)
RWriteStream::Open(RFS, filename, iFlags)

Stream to file is open

Now I wanna store CFbsBitmap to stream I use CFbsBitmap::ExternalizeL(RWriteStream)

It store some data almost the same amout like CFbsBitmap::Save(filename)
Something missing, probaply header or

Could you advise how to store CFbsBitmap to stream and after that I can use mbmviewer from SDK and I can see it?

Thanks

Thu, 2005-08-04 11:10
Joined: 2003-04-01
Forum posts: 142
Re: CFbsBitmap storing to stream
Hi

What is the excat problem that you are having ? any erro notes. I have used dictionary stored succesfully with bitmaps, so maybe you should try them as well.

yucca
Thu, 2005-08-04 12:55
Joined: 2005-06-09
Forum posts: 8
Re: CFbsBitmap storing to stream
Problem is that I need store CFbsBitmap to file through stream

But result of
RWriteStream::Create(RFS, filename, iFlags)
RWriteStream::Open(RFS, filename, iFlags)
CFbsBitmap::ExternalizeL(RWriteStream)

is not save like
CFbsBitmap::Save(filename)

So please if I start
RWriteStream::Create(RFS, filename, iFlags)
RWriteStream::Open(RFS, filename, iFlags)
what next? how to save CFbsBitmap to stream

after for test I will use
CFbsBitmap::Load(filename)

Thanks
Fri, 2005-08-05 04:42
Joined: 2003-04-01
Forum posts: 142
Re: CFbsBitmap storing to stream
check the class documentation and headers for the bitmap class, it should have internalize & externalize functions for internalizing & externalizing the image.

yucca
Fri, 2005-08-12 20:14
Joined: 2004-11-29
Forum posts: 1134
Re: CFbsBitmap storing to stream
The problem here seems to be that CFbsBitmap::Externalize() doesn't write a .mbm file, like you seem to expect,
but some internal format that only CFbsBitmap::Internalize understand. (or someone reverse enginering it).

You need to rethink your file strategy. Externalize/Internalize is mainly used when you want to pack several types of data into one file, its not ment to write any particular file standard, just any data that Internalize would need to recreate the object.

If you want to write several of your CFbsBitmap(s) in a .mbm, take a look at the CFbsBitmap::StoreL function instead.
If you only want one, why not use CFbsBitmap::Save?
If you want to create your own fileformat, go with Externalize/Internalize

  • Login to reply to this topic.