Below you can see my code, want I want todo is very simple I just want
the get the right pixelsize of the images which I export, most of my
visio pages are 744x1049 pixel,
and when I use the formulas written below I get 5xx pixels.
I need the correct information about my images, because later on I want
to draw clickable links on the images, where the shapes are located.
Hope you understand what Im trying to say.
------------------------------------------------------------------------------------------------------------------------------------------------------
Public Sub mySaveAsWeb(ByVal list As ArrayList)
Dim page As Visio.Page
Dim shape As Visio.Shape
For Each page In myVisio.ActiveDocument.Pages
Dim height As Double
Dim width As Double
height =
page.Application.ActivePage.PageSheet.Cells("PageHeight").Result("pt")
width =
page.Application.ActivePage.PageSheet.Cells("PageWidth").Result("pt")
If page.Type = Visio.VisPageTypes.visTypeBackground Then
For Each shape In page.Shapes
Dim xValueInMM As String
Dim yValueInMM As String
Dim xValueInPt As Double
Dim yValueInPt As Double
Dim newXValueInMM As Double
Dim newYValueInMM As Double
Const CONVERTTOPT As Double = 2.83464
xValueInMM = shape.Cells("pinx").Formula
yValueInMM = shape.Cells("piny").Formula
xValueInMM = xValueInMM.Replace("mm", "")
yValueInMM = yValueInMM.Replace("mm", "")
newXValueInMM = CType(xValueInMM, Double)
newYValueInMM = CType(yValueInMM, Double)
xValueInPt = (newXValueInMM * CONVERTTOPT)
yValueInPt = (newYValueInMM * CONVERTTOPT)
'yValueInPt = height - yValueInPt
Dim filename As String = ("C:\Documents and
Settings\mje\My Documents\test\Gif - files\Pages\" & page.Name &
".gif")
page.Export(filename)
page.Import(filename)
Debug.Print("X Value in PT", xValueInPt)
Next
End If
Next