A Visio user sometimes needs to create a Visio drawing based on a scanned image. But the
scanned image is usually the wrong size and may be slightly rotated.

Naturally, you can scale and rotate the drawing manually, but it takes a lot of time and it is
difficult to ensure maximum accuracy. The operation becomes much easier if you use a small
macro.

One firm needed to draw a ship deck in Visio. The original image was obtained as a screenshot
from a PDF document, so the scale is unknown. But the real length of the vessel is known, that
is, the distance between the two extreme points.

They cannot change the scale of a Visio document because it already contains several other
drawing elements, therefore need to resize the shape containing embedded image.
As a result, we decided to create a macro that implements the following sequence of
operations:

1. Draw a line between the points, the distance between which is known.
2. Enter the value of the real distance between the points in the line text.
3. Calculate the scaling factor as the ratio between the actual size and the line length.
4. Multiply the height and width of the shape by the scaling factor.
5. Also rotate the shape with the picture at the angle opposite to the angle of the line.

The technology turned out to be quite convenient, so the macro was saved among other utilities
and was subsequently used repeatedly.

See macro text in Downloads section