Hi saXso,
First thing: it's a pain. I have been struggling with this for quite a
while, but have it running. However, my solution only works for the
default setting of windows, working with a resolution of 96 dpi (as
Chris mentiones above). If you want to work in a different resolution,
you'll have to change a multiplication factor.
There are two things you need to worry about:
* Visio works in inches. This means that, to get a pixel value, you
will need to convert the internal values to millimeters and/or to
pixels. I have used the conversion to mms to be able to debug my code
(my drawings always use mms as a drawing scale). So: mmX = PinX * 25.4
gives you the mm value, and then pxX = mmX * (96/25.4) gives you the
pixel value. You can of course skip the first step and do pxX = PinX *
96
* The origin of a page is in the lower left corner, instead of the
upper left corner as with 'normal' images. This means quite some
calculations to first determine the top left corner of the image (that
depends on what objects will be exported when creating the image), and
then finding the relative location of the other objects in reference
to the top left corner of your exported image.
Anyway, this is how I have implemented it. I use it to create an
imagemap on the fly after saving a page as an image. If you want to
see the whole code, feel free to download the swipr toolset.
(swipr.blogspot.com) It'll give you all the code (in VBA), as well as
some nice utilities.
Hope this helps,
Jacco
What I have done is