You can save multiple pictures in the same stream too.
On Oct 11, 1:34 pm, "Brian Muth" <bm...@mvps.org> wrote:
The only minus I can see about this, is that it means the client has
to be smart enough to know how to read out the bitmaps from the
IStream using OleLoadPicture or whatever. I guess if I care about
that, I can just write a small in-process DLL that encapsulates the
IStream and does the decoding into an IPicture or whatever.
No, this shouldn't be necessary. On the server side, you can use
OleLoadPicture or OleLoadPictureFile to load the data and create
the Picture object, then because Picture objects also support
IPersistStream, you can save to a Stream and then pass the IStream to
the client. The client should be able to trivially rehydrate the image
using OleLoadPicture(IStream *mystream, ...)
Hmm. That's definitely true for 1 picture; I guess if there are
multiple pictures, or if some of the pictures requested are "not
found" then I could also return a SAFEARRAY with elements in the same
order of the IPictures placed on the IStream, so that the client knows
how many times to call OleLoadPicture and which pictures are which.
thanks!