Hi,

I need to Save an Image to a Stream using GDI+
Rick Strahl suggested me to try using ADODB.Stream
To make it work, I need to obtain the Handle, the memory pointer that ADO 
reserver for my Stream
This handle will be passed to GDI+ further
I've searched all over the web, but did not find any tip on that... Maybe I 
didn't look at the right places...

Any tips ?

Below is the code that I want to use for that


LOCAL loADOSTream as "ADODB.Stream"
loADOStream = CREATEOBJECT("ADODB.Stream")

*!* Set Stream Object properties.
loADOStream.TYPE = 1    && 1=Binary Data, 2=Text Data.
loADOStream.OPEN


Here I need to get the Handle, the memory pointer that ADO reserver for my 
Stream
This handle will be passed to GDI+ further


m.lhStream = ?????????????????????

*!* Save the picture to the stream
loBmp.Save(m.lhStream, .Imaging.ImageFormat.Bmp) && Pass the stream handle 
to Save method

lcPicture = ""
lcPicture = loADOStream.Read()

*!* Close connections.
loADOStream.CLOSE



My goal is to create an Image with GDI+ on the fly, and instead of saving it 
to a file, to save it to a stream. Then I can retrieve the binaries from 
that stream directly to the PictureVal property of an Image control.

Streams use some memory portions, and must have a handle, a pointer that can 
be passed to the API GdipSaveImageToStream. That's what I want, the memory 
pointer from the ADOdb.Stream object.

Any suggestion is very welcome

Cesar Chalom
My Blog




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to