T
Tim Baley
Hi all,
Can anybody tell me how to load an Access Image control with an emf in an
in-memory byte array?
I am building an interface between an Access 2K application and a SQL
Reporting Service.
I have a byte array coming from the webservice that I am inserting into an
Access report. Currently, I am saving the byte array to a temporary emf file
on disk using an ADODB.Stream and then setting the .Picture property of the
image control to the file name. I would like to use the byte array to load
the .PictureData property directly.
From Stephen Lebans' excellent site, I have learned that the difference
between my byte array and a byte array that would be a valid PictureData
property is two long integer values, the first containing CF_ENHMETAFILE (14)
and the second containing a handle for the in-memory metafile. Comparing the
output of the PictureData property to the byte array from the webservice, I
can see that this really is the case.
It appears that I can generate the metafile handle with SetEnhMetaFileBits
from the GDI32 API. But I am stumbling on how to make this
addition/translation to my byte array.
It seems like I am so close. Can anybody help me go the rest of the way?
Thanks,
Tim Bailey
Can anybody tell me how to load an Access Image control with an emf in an
in-memory byte array?
I am building an interface between an Access 2K application and a SQL
Reporting Service.
I have a byte array coming from the webservice that I am inserting into an
Access report. Currently, I am saving the byte array to a temporary emf file
on disk using an ADODB.Stream and then setting the .Picture property of the
image control to the file name. I would like to use the byte array to load
the .PictureData property directly.
From Stephen Lebans' excellent site, I have learned that the difference
between my byte array and a byte array that would be a valid PictureData
property is two long integer values, the first containing CF_ENHMETAFILE (14)
and the second containing a handle for the in-memory metafile. Comparing the
output of the PictureData property to the byte array from the webservice, I
can see that this really is the case.
It appears that I can generate the metafile handle with SetEnhMetaFileBits
from the GDI32 API. But I am stumbling on how to make this
addition/translation to my byte array.
It seems like I am so close. Can anybody help me go the rest of the way?
Thanks,
Tim Bailey