Images and the Dynamic Grid


A recent newsgroup post described a problem getting the Dynamic Grid feature to work with images.  The user inserted pictures into their diagram and wanted the same alignment aids that Visio provides for regular shapes.  This can be done with a small modification of the image shapes.  First let's look at the Dynamic Grid behavior for regular Visio shapes (i.e. shapes with geometry).

 

The shape on the right is being dragged near the shape on the left.  When the Dynamic Grid is turned on (Tools > Snap & Glue dialog), Visio displays both horizontal and vertical alignment lines.  The horizontal line indicates that the centers of the shapes are aligned.  The vertical line indicates that the shapes will be separated by a standard spacing amount.

If you try the same thing with images, Visio produces different results.

The vertical alignment line is shown, but the horizontal line is not shown.  These shapes do not have any visible geometry, which Visio uses as criterion for alignment.  When you insert a picture in Visio, the resulting shape has a geometry section but the Line Pattern is set to No Line.  It turns out that by making a simple adjustment in the shape, you can make Visio recognize the hidden geometry section and get full Dynamic Grid support.  In the Shapesheet (Window > Show Shapesheet), find the LinePattern cell and set it to 1.  This makes the shape work with Dynamic Grid.  Now to hide the rectangle around the image, find the Geometry section and set Geometry1.NoShow to TRUE.  This makes the border invisible once again but does not disrupt the Dynamic Grid behavior.

Here is the feedback when the Dynamic Grid is working with the modified image shapes.  Note that the change must be made on the shape your are aligning to (i.e. the shape not being dragged).

Perhaps Visio can make this workaround unnecessary in the future.  Meanwhile this is one way to make your images behave just like regular Visio shapes.