How to Make a Visio Stencil

I've always believed that a good illustration or diagram can be invaluable in explaining an idea. Just as people form first impressions of other people when they meet them, people form impressions about your ideas when they see them presented. A sketch on a napkin carries a sense of new-ness and excitement, but certainly not the expectation that a lot of details have been sorted out. Likewise, neat, professional illustrations convey confidence that the idea is valuable, important, and worth considering. You don't have to have a team of graphic artists working for you to make a good impression. Visio is already a powerful tool for creating diagrams and illustrations, and you can get even more mileage out of it by creating your own stencils. It's easy, and it'll help you create great drawings.

Why do you need a new stencil?

Visio's already got lots of stencils, or shapes - why would you need more? If you've ever tried to convey ideas specific to your industry or product, you know that the general-purpose shapes that come with Visio don't cover a lot of specialized needs. They also have a distinct style, which makes it hard to "brand" your drawings. But why not just drop pictures on your drawing? One reason is reusability - something that software professionals should be enthusiastic about. If you have a one-time picture, it's easy to drop it on your drawing and be done, but if you have an icon, symbol, or picture that you're going to use repeatedly, it makes sense to add it to a stencil. A good Visio shape will be sized correctly for use in Visio, and it will have connection handles so that you can hook it up to other shapes and lines. Typically, when you just drop a picture onto a Visio document, you don't take the time to set these things up, but if you do these things for your custom shapes, you'll be able to take advantage of them every time you use your shape.

Steps for a new Stencil

Ok, let's get started. I'm going to show you how to make a database shape that looks really nice. Of course, you can use the one that' built into Visio, but this one adds some real class to your doc. I'm using Visio 2003 here, but other versions are similar.

1. Pick your source image.

We're going to start with an image rendered by the Persistece of Vision (POV) raytracing program. I'm not going to attempt to do a POV tutorial here, but I've included the source for this image in the download if you want to play with it. The POV IDE lets you edit your file and render your changes. You'll find a Bitmap (bmp) right next to your source once you've rendered, and you can pick this up and start using it.

You can also grab an image from Google, a clipart CD, or a stock images web site.

2. Prepare the image.

Next, we'll resize the image and make sure its background is transparent. You'll need an image editor of some sort for this.  I'm using PhotoImpact, but Photoshop, GIMP, or any other image editor should work fine. First, select the part of your image you want to use, and make the rest of the image transparent. You want your shape to float over any other image content -- not clip it:

In PhotoImpact, the easiest way for me to do this is to select the part of the image I want using an "edge find" selector, then copy and paste into a new image. Next, create a new image with transparent background (a better tool would probably let you skip this step, but this allows me to create an image that's exactly the size of my selection), and paste the selection into it. Finally, change the properties of the selection to specify a transparent color (change the sensitivity or similarity to make white and gray, for instance, transparent).

Resize your image to a size appropriate for a Visio drawing. This will vary, of course, depending on the level of detail in your image and the size you expect to typically use in a drawing, but here's a point of reference: the small image in the download is 55 pixels wide by 70 pixels tall, and when used as-is in a Visio drawing, you end up with a shape that's 3/4" wide by an inch tall - a pretty good size.  You will be able to resize your image to be larger or smaller, of course, but if you leave your source image too large, you will cause every drawuing that uses that shape to consume more storage than it needs to.  On the other hand, if you make your image too small, you risk losing detail when your image is resized larger. Shoot for a size that's maybe just a bit larger than you think you need -- it'll survive resizing while consuming a reasonable amount of disk space.

When you're done editing, save the image as a PNG, which has the color depth of a JPG, but allows you to keep the transparent channel, like GIF.

3. New Stencil and Master.

Open Visio. The first time through, you want to create a new stencil to hold your new shape, so choose File ... Shapes ... New Stencil. You'll see a new panel in the Shapes area titled "Stencil1" or similar. Right-click on the title bar of this new stencil and Save As to change its name. By default, Visio will save your stencils into My Documents / My Shapes, which is pretty convenient compared to earlier releases of Visio.

Next, you want to create a new Shape, or Master. Right-click in area beneath the title bar and choose New Master. You should see a pop-up window similar to this:

Name your shape, and leave the other properties alone for now. Choose Ok, double-click your new Master's icon, and behold the big, empty grid. Don't worry - you're almost home.  Add your image onto the master by choosing Insert ... Picture ... From File... from the menu. Why not drag & drop? I've seen transparent-background images lose their transparency when dragged into Visio - if you Insert from the menu, this doesn't happen.

4. Add Connectors.

You'll want to adjust the zoom in Visio to make your shape easier to work with - try 200% or so. Next, we're going to add some connection points, because shapes in Visio are much more usable when they "stick" to one another properly. Choose the Connection Point Tool on the toolbar.  Now, hold the CTRL key and drop on some points. For a square or rectangular image, you'll want points top and bottom, left and right.  Larger shapes can use more connectors, and specialized shapes may call for points in specific locations - remember, these are the spots where lines and other shapes will attach, or snap to.

That's it - you're done! Click the document close "X" or choose File ... Close, and answer Yes to the prompt to save changes to your master. Your new shape is ready to use.

5. Repeat!

Once you've got a stencil, it's easy to add new masters. After a while, you'll have a collection of distinctive shapes that add a unique style to your drawings. Using them is easy and effective - they're going to work just like the shapes you already have.

RSS API for IE7 – now we’re talking!

I'm sure this is abundantly apparent to anyone leafing through the articles on this site that I'm a big fan of RSS. Microsoft is finally starting to make some noise in this area, and it's the start of something big. Take a good look at what's happening right now in RSS, because in five years, this is going to make SOAP look like a fad.Ok, some really brief history for those new to RSS:

  • RSS began as a news syndication protocol. News-oriented sites could encode summary info about articles with links to their sites. This allowed "subscribers" to have a "Slashdot news" block on their site. Great viral marketing for both parties. Notice that this is strictly a B2B-type interaction.
  • With the advent of blogs, RSS started getting personal. More sites began using it, and more readers wanted it. Enter the RSS reader (RSS Bandit, NewsGator, etc.). It's now common for people to track dozens of feeds, and RSS feeds begin to displace email newsletter subscriptions. The practice of using RSS just to link back to the "real" article begins to fade (put your content in your feed, or don't bother me).
  • Podcasts. Did you know what a podcast was a year ago? 'Nuff said?

So here we are, early in 2006. What more can happen with RSS?

Lots, really. We're really still in the "early adopter" phase of RSS growth. Microsoft's push will help that along nicely. FireFox has already started to ramp people up on the concept of RSS, and IE7 will accelerate that growth. But there's a lot more to Microsoft's capabilities than are apparent at first.

Check out a couple links from Microsoft:

Using the Microsoft Feeds API This shows the API for the RSS feed that IE7 uses. Not too sexy, but you can see that the API is reasonably comprehensive, and it's getting built into IE7, which will eventually ensure that it's ubiquitous.

Simple Sharing Extensions for RSS and OPML This one's quite a bit fuzzier, but if you squint at it sideways, you can make out the shape of a killer platform. Let me explain:

The point of SSE is bi-directional synchronization. The thing about RSS to-date is that it's been strictly unidirectional. Publish-subscribe. Or don't subscribe. That's it for options. Now, you start opening up the possibility of synching back and forth, and things start to get interesting.

RSS is about to exit the "news" business.

The thing that makes RSS work is the ability to share "articles" in a universal format. As we've moved from news to blogs to podcasts, we're stating to see RSS used to publish "items" instead of "articles". The ubiquitous availability of RSS and the existence of a synching protocol for RSS mean that we've got a kick-ass collaboration engine just over the horizon.

There's a new calendaring app that's hit some Microsoft blogs recently: 30 boxes. Right now, it's best-known for its great use of AJAX, but it's also built to be able to share calendars, and this can give us a great glimpse into what's coming in a big way as RSS matures. Imagine subscribing to someone's calendar using an RSS mechanism, and then being able to update items. Obviously, there's a little matter of security to deal with, but the concept is pretty powerful.

When you consider the online-offline multi-client capabilities that RSS shows right now, this is going to really open up collaborative apps on a new scale. You can imagine how this works for a calendar. Open up the idea of "items" to include contacts, to-do's, etc., -- I hope we'll see stuff like this in the next Outlook. Hopefully, you can see this extending to enterprise stuff, too -- CRM info, stuff that's landing on portals right now, and so on. Clearly, none of these are things that can't be done now, but most of them are things that aren't being done because it's too difficult for users. The next generation of collaboration will marry the ease-of-use of today's best apps to the resilient, flexible infrastructure that RSS brings.

Now, the potholes. I already mentioned security. Versioning will need to be addressed. And finally, the scalability and reliability of Microsoft's RSS store will be mightily tested when this starts to take off. I expect the RSS store to turn into the new registry -- a brilliant idea that ends up being used for stuff far beyond its initial intended use. It'll probably need a little time to be able to handle everything that's going to be thrown at it.

Remember, you heard it here first.

Rant: What does version 0.1 mean?

I'm wading though the shambles of tattered source code left behind by an employee who used to work for another department in my company. It seems I"ve inherited the system that this guy and some of his also-departed co-workers put together for a customer of ours. There's documentation for the system, but nothing that documents anything I'd really want to know, so I'm surfing through the source code trying to soak up some intent, and I find one of the few classes that has any comments. In the comments, there's a version number. It's "0.1".Version 0.1??

What's that supposed to mean? As far as I can tell, this is a lame attempt to divert blame if a bug ever turns up. "A bug? Well, what're you getting so bent out of shape about?? It's only version 0.1!" As if this were really an indemnification against defects, freeing the developer from any real responsibility to get anything right.

What's the big hangup about taking enough responsibity for delivered code that you'll put a 1.0 on it? This wasn't a demo, it wasn't a prototype, and it wasn't still in testing. This code was delivered to the customer, and it's being used in production.

There's a principle at work here about not delivering something half-done to a customer. If you're about to deliver something that's worthy of a 0.1 version number -- stop! Your customer deserves better than this. If you're delivering something that's done, then guess what? You can slap a 1.0 on it with no qualms whatsoever. Let your version number be another clue that can tell you if you're delivering what you're supposed to be delivering.

End of rant.