Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memory pointer from ADOdb.Stream
Message
De
19/03/2007 11:12:15
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Memory pointer from ADOdb.Stream
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01205533
Message ID:
01205533
Vues:
76
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")

*!* 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
Thanks in advance

cesar Chalom
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform