BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Windows Enhanced Metafile pictures and surrounding Alignment Box

Started by snuuba, February 20, 2020, 05:32:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Hello all,

I've used "Windows Enhanced Metafiles" as background images for my shapes for a while now. While building the background image, the image is ungrouped and there are many separate visio objects, each with their own shapesheet to have more control over the image. As I am about to add the background image to the actual shape, I will copy all the component objects and then paste them back using "Paste - Special - Picture (Enhanced Metafile). As a result you will have a single object with just one shapesheet. This will reduce the size of the object and number of shapesheets associated with the image, making the shape much faster to use and pull from stencil.

There has been a slight hiccup with this solution. When the image is pasted back, the dimensions of the shape increase as an alignment box is added around the image. Furthermore the actual image is off centered relative to the alignment box. As a result you can not use formulas relative to shape dimensions to position the shape, the off centered nature will position the image in slightly wrong position and you will have to position the image manually.

Few days ago I was browsing through the forum and found a topic where someone was using "crop" tool. I had never used it before and decided to give it a try to see if the problem with metafile pictures and alignment box could be solved by using "crop" tool.

As it turns out, it worked. Not a perfect solution, but good enough for me.

Detailed steps can be found from my blog:

I tried to copy the blog post here, but it didn't work out, probably because of the images used. I hope you don't mind links pointing outside of the forum...


Cropping is a tedious process. Many people use a different technology - they group the external frame (Visio shape) and the internal content (Metafile). This technology provides metafile benefits and dimensional accuracy.



Your way is roughly the way I am actually using metafile. In case of a rack mounted equipment, create a line that is 19" long, group it, change the group to 1-dimensional shape and add the metafile in that group.

For the metafile I would like to use following shapesheet settings to position it:
PinX:!width*0.5 (parent shape width*0.5)
PinY: Height (of the metafile)
LocPinX: Width*0.5
LocPinY: Height

However if I do that with uncropped metafile, the image is positioned incorrectly due to the offset with the alignment box. The image actually lands slightly too high and too much right and I have to adjust shapesheet values a bit or manually drag the image in the correct position.

With cropped metafile, the image is positioned right in the middle horizontally and at the correct height

In the attachment I've left the "line" shape used to make the group in place to make the difference more obvious, normally I would remove it. The upper shape is with uncropped image and it sits little bit too high and too much right. While the second shape is with cropped metafile and it is positioned correctly. Both are using the same shapesheet positioning settings.


Maybe attached example shows better what is happening with pasted metafiles.

- The same 19" line grouped and then turned into 1-dimensional shape
- Two rectangles added to the group
- Green rectangle is just a basic visio rectangle shape, 19" wide, 3.5" high
- Red is the same shape, just color changed to red, then copied and pasted back as metadata image, the size is now 19.3323" x 3,8866"
- Both are using the same shapesheet settings for positioning
- Yet metadata shape sits too high and too much right, due to extra slack around the rectangle shape and off centered positioning of the actual rectangle shape with in its own alignment box


Changed line patterns slightly, so you can see overlapping shapes.

By cropping the metadata image, you can actually make it to land nearly ideal position and overlap green rectangle, while using the same shapesheet positioning settings. There are still some differences as I didn't spend too much time with cropping.

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 218 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1074KB.
Tokens: post-login.
Cache hits: 13: 0.00137s for 26,764 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]