GetStdPictureFromPicData ?

H

Hine

Stefen Lebans did something that transformed an OLE-StdPicture into a
PictureData DIB (Access-Image-Format) :

Function GetPicDataFromStdPicture(hStdPic As Object) As Variant

Now I need something that does the oposite:

Function GetStdPictureFromPicData(varPictureData As Variant) As
StdPicture

anyone seen this ?

Henry
 
S

Stephen Lebans

THe code to accomplish this is on my site somewhere but I cannot think of
where at this moment.
Just to clarify your issue, what type of Image did you load into the
standard Image control that you need to generate a StdPic handle for?

In case there is an easier method available, what exactly do you need to
accomplish here?

Finally, if the Image resides on disk, then you can simply use the VBA
LoadPicture method to load and return a handle to a StdPic object.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
S

Stephen Lebans

I just did a quick GoogleGRoups search on this topic. I found an old post of
mine that contains the simplest solution.

If the Picture resides in an Image control then the simplest option is:

1) There is a SysCmd call that allows you to create an IPictureDisp for
an Image control. You can them simply call the SavePicture method of
that interface to save the Image to a disk based Bitmap. THis is from
memory from one of the ADH volumes.


Dim pic As stdole.IPictureDisp
set pic = SysCmd(712,NameofYourImageControlHere)
SavePicture pic,"WhateverYouWantForaPathFileName"


If the Image was set into the Picture property of the Form then there is
code on my site showing you how to save the contents of the PictureData
property to disk.



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top