
ActiveX - Image Control - Picture Property
VB5 - VB6 on the shelf(all my DOCS are VB5)
I'm trying to create an ActiveX control that I can use in
VBA under
Access. In VB5 Form Design view I need to create a memory metafile on
the fly and assign it to an Image control on my ActiveX container.
in VBA at Form Design time I can do:
1) Crea{*filter*}hMetaFile
2) GetEnhMetaFileBits
3) apiCopyMemory(varpicture(8), ByVal lngMemoryLock, lngAllocMem)
'Setup first 8 bytes special EM record to show ctl placement to mimic
Access's memory profile of a loaded 'metafile
'EOF = 14
'Bytes 0 -7 = (14,0,0,0,50,50,0,0)
varpicture(0) = 14
varpicture(4) = 50
varpicture(5) = 50
4) ctlImage.PictureData = varpicture
The VBA Image control now displays the created metafile. As the control
is resized it looks after resizing its contents.
The Image control in VB5 has a Picture property but not an actual
PictureData property. The helpfiles say you can do Picture1.Picture =
Picture2.Picture
Can I somehow do Image.Picture = varpicture
I understand how I could PLAY the metafile into the image control. But
is that the same thing as loading or in this case assigning the
metafiles contents to the Image.Picture property.
My logic here, or lack thereof, is to have the Image control, set to
stretch, to look after all resizing requests. This will ensure that the
control is always automatically displaying its contents at the proper
resolution, whether screen or the printer.
If you hadn't already guessed, :-) this is my first ActiveX control.
It's finished except for the details with the Image control.
Thanks for any input.
Stephen Lebans
http://www.*-*-*.com/ ~slebans/