Visio Tutorial: Advanced Fill Effects
While I was writing about the Visio Spectrum Shape the other day, I started thinking about the various ways that you could use this eyesore fabulous explosion of color in your own Visio SmartShapes.
While the spectrum offers a rainbow of tints, it only comes in one form: RECTANGLE. So what if you want to spice up some arrows, or circles, or…flowchart shapes?
Since Visio isn’t a full-blown, artistically-bent illustration application, we have to make-do with tricking it to do our bidding.
And what office worker could resist the temptation to add stuff like this to his business visualizations?
Ok, enough horsing around.
Yes, we’re using the frivolous spectrum shape as the basis for an “advanced fill” effect in Visio, but you could easily come up with useful fills that would seriously improve your drawings. And learning new techniques will just make Visio a more powerful tool in your arsenal.
So let us know what you come up with by leaving comments at the end of the article!
There are two ways that I came up with to get the spectrum shape (or any other fancy fill) to fill irregular outlines:
- Create a mask
- Create a custom fill pattern
The mask technique is a bit destructive, so if you are using SmartShapes, be sure to get just the size you want first, and work with a copy.
Many Visio shapes have smart geometry that keeps parts of the shapes from stretching or shrinking as you resize them. You can learn more about SmartShape geometry in Why Visio Shape Smarts Makes Your Life Easier and A SmartShape is Worth 1000 Symbols.
But it is important to emphasize that we will be destroying smart behaviors in the shape you want to fill with the mask method.
Imagine we want to fill an arrow with the spectrum pattern. The first thing we need is an arrow, which we can find under: File > Shapes > General > Basic Shapes. On the Basic Shapes stencil, you’ll find a whole bunch of smart arrow shapes. I’ve used the 45 degree single here.
Once we’ve got the arrow sized to our liking, we draw a rectangle around the arrow. We then size the spectrum shape to match the size of the rectangle, or perhaps a tad smaller.
Using the Z-order commands under Shape > Order, we can arrange the arrow to be on top, the rectangle to be in the middle, and the spectrum to be behind. Keyboard shortcuts of Ctrl+Shift+B (send to back) and Ctrl+Shift+F (bring to front) will help you to do this more quickly.
We should have something like this, except that the spectrum will be lined up with the other two shapes:
Now we want to use the arrow to punch a hole in the rectangle. We can do this with Visio’s Boolean operations, which allow us to add and subtract shapes from each other in various ways.
So select both the arrow and the rectangle, then combine them using Shape > Operations > Combine. You should see something like this:
You’ve created a mask! And you’ve also destroyed the smarts for the arrow. You can see here that the arrow maintains it’s head-proportions–like a good SmartShape, but the mask squishes like a DumbShape:
Now that you’ve built your nifty mask, get rid of the black outline by giving it No Line formatting:
Then make sure it is lined-up with the underlying spectrum shape:
For convenience, you can select both shapes (mask and spectrum) and group them together (Shape > Grouping > Group or Ctrl+Shift+G)
If you want an outline around the arrow, then just get a copy of the original arrow, give it No Fill, and place it over the mask and fill combination. Now you’ve got three shapes to manage. If you want an outline around the arrow that is a little more elegant, then try the following…
Advanced topic: To keep the outline around the arrow, but not around the outside of the white rectangle more efficiently, you can use a little ShapeSheet magic.
- Select your mask shape
- Choose: Window > Show ShapeSheet
- Look for the sections in the ShapeSheet that start with Geometry
- The outer rectangle will have five rows in it. Find the NoLine cell at the top of this section
- Set the NoLine cell-value to TRUE
You should now be able to give your mask shape a line, but the outer edge will remain without a line, as shown in the second shape below:
In case the arrow is too boring for you, here’s another example. Starting with a gray “007” shape that I’ve been working on and a white background-rectangle, I was able to combine the two to make a mask:
If you want to get more sophisticated and tricky, you might come to the idea of rotating the pattern. When you do this, though the spectrum must be really big to fill in your shap, as shown in the next illustration.
At first glance, it appears that our mask will have to be huge in order to obscure the pattern. But there’s another trick: we can crop the pattern so that it fits into a neat, right-side up rectangle.
To crop a rotated spectrum, it needs to be a metafile or bitmap. Normal Visio shapes don’t support cropping. So copy or cut the spectrum shape to the clipboard, then paste it using Edit > Paste Special. In the pop-up dialog, you can select to paste as a metafile (Picture) or a bitma.
Now we can use the Crop Tool to get rid of the excess, and keep our mask shape small and compact as before.
Here’s a visual summary of the steps:
For more on masks in Visio, have a look at: Super Mask Visio Clipping Shape!
The second method involves creating a custom fill pattern, which is less complicated but more obscure, in my opinion. One benefit of using this method is that you don’t have to destroy your original smart shape!
This technique is very similar to what was discussed in a previous article: Masking Images in Visio, but lets go over the steps using the spectrum shape, our arrow and our “007” shape.
The first thing we need to do is create a container for our custom fill pattern. So make sure the Document Explorer window is showing. You’ll find it under the View menu, if you don’t see it already.
Find the Fill Patterns node, then right-click on it and choose: New Pattern…
In the pop-up dialog, enter a pattern name, and choose the right-most icon for the fill-behavior.
Before we edit the pattern, make sure you copy the spectrum shape first. Now we can go into the pattern container and add the details.
You can right-click on the pattern-node and choose: Edit Pattern Shape, or just double-click it. Once you’re inside, you can paste the spectrum shape. But don’t just do a regular paste!
Visio won’t recognize a pattern-shape that has lots of gradient fills, but it will accept bitmaps as custom patterns.
So we can do a Paste Special of our spectrum shape. Go to the Edit menu and choose Paste Special. There you’ll see a list of options, from which you should select Device Independent Bitmap.
Once you’ve pasted the spectrum as a bitmap, close the pattern window and accept changes.
You can now apply your new custom pattern to any shape by simply visiting the Format > Fill dialog:
As you can see, custom patterns are listed at the bottom of the Pattern drop-down by name, not by preview (unfortunately).
And we don’t have to destroy the smarts on our original smart arrow to get the effect:
Now those with sharp eyes might notice that the spectrum is being cut off on the shorter arrows.
This is related to the “expand” fill behavior we chose in the Pattern Properties dialog. Below, I’ve placed a faded version of the pattern-shape, then drawn various-sized rectangles over the top of it.
You can get an idea of the effects of shape size relative to pattern size.
I don’t have any sage words of advice for this problem other than make the proportions of your pattern close to those of your target shape(s), if possible.
Here’s the “007” shape with the Spectrum custom pattern applied:
You may have noticed the rotated effects that I used for this article’s thumbnail:
To get this to work, I combined number of techniques described in this article. Inside of a custom pattern container, I did this:
- Pasted the spectrum shape
- Rotated it
- Cut it to the clipboard
- Pasted it via Paste Special as a bitmap or metafile
- Cropped it to a square
- Cut the cropped version
- Pasted it again using Paste Special, as a bitmap
You don’t want a cropped shape inside of a custom pattern, because it will cause funny, offset results when you apply it as a fill pattern. That is the reason for the multiple paste special steps: to make sure the final pattern shape is a rectangle with no cropping.
Well, I hope you have fun creating all sorts of crazy effects using these methods. Leave a comment below and let us know what you come up with and whether or not you find articles like this helpful and interesting!