How to identify the correct position of shapes in Visio

K

Kumar

I am developing a program in Visual C++ to read shapes in Visio drawing XML
document (.vdx) and draw in MFC dialog . I need to know the actual
postion(x,y) of shapes in XML in order to draw the shapes in MFC dialog .

I read the position by reading the <PinX> of <XForm> tag but I did not get
the shapes in actual position. Specifically I think the position of the
lines are not correct.

Can you please help me in this regard.
 
C

Chris Roth [MVP]

Hi Kumar,

The location of a shape is a combination of it's Pin, it's LocPin, and it's
Angle and Flip as well. Also, geometry can be outside of the shape's
width/height box, and geometry is specified in the local coordinates of the
shape.

The LocPin specifies where on the shape the Pin hits. For instance, a LocPin
at (0, 0) is in the lower-left corner. The default Pin is at (Width*0.5,
Height*0.5) You can see that this in the local cooardinates of the page.

The Pin is where the shape is located on the page.

--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/
 
K

Kumar

Hi Chris,

Thank you very much for quick reply.

Actually I was able to locate the position of shapes other than lines as
you mentioned . I could not get correct position of lines as in the Visio
document.

For line shapes I used the <PinX> in <XForm> as other shapes but the lines
are little deviated from actual position ( not connected to other shapes) in
MFC dialog


Regards,
Kumar
 
K

Kumar

Hi ,

Thank you.

I tried as you said but I still could not get the correct position of lines .

I am sorry for not responding quickly .

I need more favor from you . Is it possible to forward my Visual C++ project
, which I developed to you (to your hotmail )for identifying the mistake I
made.

Regards,
kumar.
 
M

Mark Nelson [MS]

Keep in mind that shapes can be inside groups. In that situation there are
multiple transforms that must be read and applied to get the actual page
coordinates.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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