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 reserved 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...
I want to try the ADOdb.Stream class because using the normal Stream access, with direct API calls to CreateStreamOnHGlobal and directly managing the memory or using Calvin's wrapper class for IStream, that he provided at this very cool post Calvin Hsia's WebLog : Use an IStream object to avoid disk access
http://blogs.msdn.com/calvin_hsia/archive/2006/02/17/534529.aspx , I'm having some bad performance results.
I expected that using streams, we could have a better performance than saving an image to the disk, but that's not what is happening using these 2 aproaches.
That's why I want to try with ADOdb.Stream, to check if ADOdb managed streams in a different way.
Any tips ?
Below is the code that I want to use for that
LOCAL loADOSTream as "ADODB.Stream"
loADOStream = CREATEOBJECT("ADODB.Stream")
loADOStream.TYPE = 1
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 = ?????????????????????
loBmp.Save(m.lhStream, .Imaging.ImageFormat.Bmp)
lcPicture = ""
lcPicture = loADOStream.Read()
loADOStream.CLOSE
Thanks in advance
cesar Chalom