We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to align a few shapes

Hello,

I would like to align (horizontal) a few shapes I have on the same page of a Visio Diagram created with Aspose Diagram from a Visio Stencil.

Is it possible?
If yes, please, could you provide an example?

thanks

jm


Hi Josep,


Thank you for your inquiry. You can set shape properties like position, alignment and text etc.

Shape shape = new Shape();

//Specifies the x-coordinate of the shape’s pin (center of
rotation) in relation to the origin of the shape.

shape.XForm.LocPinX.Value = 10;

//Specifies the y-coordinate of the shape’s pin (center of
rotation) in relation to the origin of the shape.

shape.XForm.LocPinY.Value = 20;

// Determines the vertical position, relative to the origin of its parent, of

// a horizontal guide or guide point to which the shape’s top border is aligned.

shape.Align.AlignTop.Value = 5;

// Determines the vertical position, relative to the origin of its parent, of

// a horizontal guide or guide point to which the shape’s bottom border is aligned.

shape.Align.AlignBottom.Value = 5;<o:p></o:p>


For details please visit documentation links below:
http://www.aspose.com/docs/display/diagramnet/Adding+a+New+Shape
http://www.aspose.com/docs/display/diagramnet/Setting+XForm+Data

In case any ambiguity, please let us know. We will take a closer look and guide you accordingly.