You can create your own fill patterns, line patterns, and line ends. For ease of discussion, these styles are collectively termed custom patterns and appear to users as options in the Fill and Line dialog boxes. To design a custom pattern, you create a master pattern that represents one instance of the pattern, such as a dot that, when applied as fill, looks like a complete pattern, such as polka dots. A master pattern is a special type of master that appears to end users only as an additional fill pattern, line pattern, or line end.
When you create a master pattern, you set its properties to specify the following:
- The master pattern name
- The type of custom patternfill pattern, line pattern, or line end
- The pattern's behaviorhow the custom pattern is applied to a shape and how it changes as the shape is stretched or formatted
- The custom pattern's use in scaled or unscaled drawings
A custom pattern is always saved as a master pattern, though it is not visible in the stencil. Master pattern names appear in alphabetic order at the bottom of the appropriate list of options in the Fill or Line dialog box. Users can then apply the custom pattern by clicking the Line or Fill command on the Format menu, and then selecting the master pattern name from the appropriate list. Custom patterns appear in the Drawing Explorer when a stencil containing them is open and they have been applied to shapes in the drawing.
For other useful information on patterns, search the Microsoft Visio Help (on the Help menu, click Microsoft Visio Help).
In this section
Creating a Custom Pattern
When a user applies a custom pattern, its master pattern is copied to the document stencil. The custom pattern then remains available in the active document, even if the stand-alone stencil containing the original master pattern is closed. The Microsoft® Visio® engine records the choice by inserting the USE function in the FillPattern, LinePattern, BeginArrow, or EndArrow cell. For example, if a user applies a custom line end called "Star" to the begin point of a line, the BeginArrow cell of the line will contain the formula USE("Star"). The Visio engine applies the custom pattern based on the size of its alignment box.
If a user does not apply a particular custom pattern from a stencil while the stencil is open, it no longer appears in the Fill and Line dialog boxes after the stencil containing it is closed.
If a user copies a shape formatted with a custom pattern to another document, the usual inheritance rules apply. The master pattern is copied to the new document, unless the new document already contains a master pattern of the same name, in which case the document master of that name is applied.
Many of the techniques that you use to develop master shapes also apply to developing master patterns. For example, youand your userswill have more predictable results if you use a single shape or a group in your master (shape or pattern). You can always combine multiple geometries to create a single shape using the commands on the Operations submenu of the Shape menu. In addition, you should create a master pattern as a single instance of the minimum design to repeat as intended.
Note Do not use text or gradient fills in a master pattern. They do not appear when the pattern is applied to a shape.
To create a custom pattern
- Open a new document or stencil.
- On the View menu, click Drawing Explorer Window. In the Drawing Explorer, right-click the Fill Patterns, Line Patterns, or Line Ends folder, and then click New Pattern on the shortcut menu.
- In the Name box, type the custom pattern name as you want it to appear in the Fill and Line dialog boxes.
- Under Type, click Line Pattern, Line End, or Fill Pattern.
- Under Behavior, click an option to specify how the pattern is applied to a shape.
- Select Scaled if the custom pattern models an object with real-world dimensions.
- For example, if you're creating a fill pattern of 4-inch-square kitchen tiles, select
- to preserve the pattern dimensions when the pattern is applied to a shape on a scaled drawing page.
- Click OK to create a new, empty master pattern.
- Open the appropriate folder, and then right-click the name of the pattern you just added. Click Edit Pattern on the shortcut menu to open the master drawing window, where you can draw the custom pattern.
- If you want users to be able to change the color of a pattern or line end after it's applied to a shape, design the master pattern in black and white, as described in in
- Developing Custom Fill Patterns
- later in this section.
- With the master drawing window for the pattern still open, click Page Setup on the File menu. On the Page Size tab, click Size to fit drawing contents, and then click OK.
- After you create the pattern, close the master drawing window, and save the document as a stencil.
Although the icons for the patterns you create are not visible when you save a pattern in a stencil, the patterns you defined appear at the bottom of the appropriate lists in the Fill and Line dialog boxes when that stencil is open. When a custom pattern is applied to a shape, the pattern name is added to the list in the current Drawing Explorer window.
Note Beginning with Visio 2002, you can create a custom pattern that is based on a bitmap and apply that custom pattern to line ends, fills, and line patterns. You can use only one bitmap object to create a custom pattern. If you attempt to create custom pattern that includes more than one bitmap, only the first bitmap in the pattern is used and the remaining bitmaps are ignored when the custom pattern is applied to a shape. Added geometry and any transforms or transparency applied to the bitmap are also ignored.
Developing Custom Fill Patterns
You can design custom fill patterns that fill a shape in one of three ways, depending on the behavior you choose in the master's Pattern Properties dialog box. The most common type of fill pattern behavior is tiled, where instances of the pattern are repeated to fill the shape from the lower-left corner outward, as shown in the following illustration.
You can also create a centered or stretched fill pattern. In a centered pattern, a single instance of the pattern fills the shape. The pattern's pin is aligned with the shape's pin. In a stretched pattern, a single instance of the pattern is stretched horizontally and vertically to fill a shape. The position of the pattern's pin is disregarded. As you resize the shape, the pattern resizes, too, unlike tiled or built-in patterns.
Fill pattern colors
If you design your fill pattern in black and white, users can set the pattern color when they apply it to a shape as they can any Visio pattern. White areas (line or fill) in your pattern inherit the foreground fill color of the shape to which the pattern is applied; black areas (line or fill) in your pattern inherit the shape's background fill color. If your pattern contains any colors other than black and white, the pattern retains those colors when applied to a shape.
Designing tiled patterns
The most common fill pattern behavior is tiling, in which the pattern is tiled by the edges of its alignment box. You can get different tiling effects by creating a pattern with a larger or smaller alignment box (as the following figure shows) or by placing the pattern off-center within its alignment box. For details about creating a custom-size alignment box, see Adjusting the Size of a Shape's Alignment Box in https://msdn.microsoft.com/en-us/library/aa217380(v=office.10).aspx Chapter 11, Arranging Shapes in Drawings.
When your tiled pattern represents a real-world object, select Scaled in the master pattern's Pattern Properties dialog box. For example, a 1-ft by 1-ft ceramic floor tile should always be the same size, regardless of the drawing scale in which it is used. The default fill pattern behavior is unscaled, which means the pattern behaves like the built-in Visio patterns: They always print at the same size, regardless of drawing scale.
Developing Custom Line Patterns
By applying a custom line pattern, a user can reformat a line as railroad tracks, a garden path of stepping-stones, or any other line pattern. When you design a line pattern, consider how the pattern repeats along the length of the line and around curves and corners. Consider also whether the pattern should be resized when the line weight changes. These considerationsthe pattern's behaviordetermine how the Visio engine applies the pattern to a line and can dramatically affect the line's appearance.
You choose a Behavior option in the master pattern's Pattern Properties dialog box to control how a line pattern is applied to a line. You can design line patterns to behave in one of four ways, as the following illustrations show.
To create a railroad track, each instance of the pattern is bent to fit around curves as it repeats along the length of the line.
To create a garden path, each instance of the pattern is positioned and rotated as it is repeated along the length of a line.
To create a tapered line, a single instance of the pattern is stretched along the entire length of a spline.
To create a flow line, the pattern is repeated on top of the line, fitting whole instances of the pattern between corners. The alignment box in this example is larger than the arrowhead to control the spacing between instances of the pattern.
Customizing the alignment box and pin
To design an effective line pattern, you must consider the size of the alignment box and pin position as well as the shape of the pattern. In fitting a pattern to a line, the pattern's pin is aligned to the line and repeats or stretches the pattern by the edges of its alignment box. If the alignment box is larger than the pattern, spaces appear between pattern instances as they repeat on the line. If the alignment box is smaller than the pattern, you'll get an overlapping effect when the pattern is applied. For details about creating a custom-size alignment box, see Adjusting the Size of a Shape's Alignment Box in https://msdn.microsoft.com/en-us/library/aa217380(v=office.10).aspx Chapter 11, Arranging Shapes in Drawings.
Scaled versus unscaled line patterns
If you design an unscaled line pattern (that is, the Scaled option is cleared in the master pattern's Pattern Properties dialog box), when a user applies the line pattern, the Visio engine resizes its alignment box until its height equals the line weight. Scaled line patterns keep their dimensions regardless of the drawing scale or the line weight.
Color in line patterns
When you design a line pattern, apply black to the areas (line or fill) that you want users to be able to change by choosing a new color in the Line dialog box. Apply white or any other color to the areas you don't want users to be able to change. Set the fill of your line pattern to None if you want the fill area to be transparent when applied to a line.
Developing Custom Line Ends
A custom line end is the simplest type of custom pattern to createit's simply a shape that can attach to the endpoint of a line. When you design a line end, you determine whether it can adjust to the direction of the line to which it's attached and whether it resizes as the line weight changes. You can design a line end to do the following:
- Orient itself with respect to the line. If you move the line, the line end adjusts to point in the same direction.
- Orient itself with respect to the page. If you move the line, the line end remains upright as viewed on the page.
The Visio engine attaches the pin of the line end to the endpoint of a line. If the line end behavior is to orient with respect to the line, the line is trimmed between its endpoint and the bounding box of the line end for a seamless look. Otherwise, the line is not trimmed. As you design a line end, consider where to place the pin to achieve the right effect. For example, to design an arrowhead, you would draw a triangle, and then move the pin to the pointing tip.
Note A line end must point to the right; otherwise, it won't be applied properly.
Tip To move a 2-D shape's pin, right-click the shape, point to View, click Size & Position on the shortcut menu, and then choose an option from the drop-down list in the Pin Pos field. Or select the shape with the Rotation tool, and then drag the pin to a different position.
Another consideration in designing a line end is whether its size should be affected by the weight of the line to which it is applied. If you design an unscaled line end (that is, leave Scale cleared in the master pattern's Pattern Properties dialog box), the height of the line end's alignment box is set to equal the line weight as long as the user sets Begin size and End size to Medium (the default) in the Line dialog box. However, on a 1-pixel line, the line end might not be visible. To ensure that your line end works at any line weight, you can customize its alignment box. If a user sets Begin size and End size to something other than Medium, the line end resizes in the same way any line end resizes. For details about creating a custom-size alignment box, see Adjusting the Size of a Shape's Alignment Box in https://msdn.microsoft.com/en-us/library/aa217380(v=office.10).aspx Chapter 11, Arranging Shapes in Drawings.
If your line end represents an object with real-world dimensions, such as a fitting at the end of a pipe, select Scaled in the master pattern's Pattern Properties dialog box. The Begin size, End size, and Weight settings in the Line dialog box will have no effect on the size of a scaled line end.