VXDSP Support Notes: 
Bitmap Notes
Home Visio VXDSP VXDSP Support Notes This page

Overview

This page discusses a number of bitmap techniques of interest in Visio.

SaveAsWeb Addon

The SaveAsWeb Addon is now documented at msdn.mirosoft.com:  link

Bitmap Exports

If you want to Automate your own bitmap exports (unrelated to the SaveAsWeb function), you can use the Page.Export or Shape.Export function and specify the filename extension of the image format you want. For example:

ActivePage.Export "c:\junk\test.gif"

However, that doesn't provide any opportunity to set any parameters for the filter.

I had a lengthy debate with folks at Visio about this, because to me it seems to miss out on an opportunity when there's an elaborate SaveAsWeb feature, but there's no facility to allow people to write exactly the image/html code that they want. At any rate, for now there is no Automation access to the filter settings.

But, the filter settings are "sticky" -- that is to say, once you set them they stay that way until you change them or quit Visio. Unfortunately they are *not* saved in the Registry or anywhere else between sessions.

Anyhow, any method that sets the filter up the way you want it can then be used on subsequent Exports. That leads us to some indirect methods to get what we want via VB/Automation:

a) Manually SaveAs to set the filter the way you want it before using Automation to export. Obviously not practical if you are trying to fully automate a process.

b) Use SendKeys to activate and manipulate the SaveAs dialogs. This is tedious but it does work. I don't like it because it seems like it would be vulnerable to interruption by the user, and also vulnerable to any changes in updates to Visio.

c) If the export format is one of the ones that SaveAsWeb can perform, then before your program performs your desired bitmap exports it could first do a "dummy" SaveAsWeb operation, accessing the filter settings through the SaveAsWeb object model.

So, (b) is probably the most generally applicable, even though I don't like it.

Bitmap Resolution Setting:

When you set the resolution in one of the filter dialogs, this has an unexpected effect. It correctly tells Visio how to convert the drawing to dots -- for example a setting of 300 dpi tells Visio to translate 1 inch on the drawing to 300 dots in the bitmap. However, it fails to set the image's specification of its resolution. So, if you use Visio to create a TIF (for example) using the 300 dpi setting, some other drawing package will think it's 96 dpi, and that its overall size is therefore 3.xx inches. The only way I know to correct this is to write code that understands the file format and knows how to tweak the resolution specification to the correct value.

Bitmap Resolution:

The main topic here is that if you are using Visio to export bitmaps of drawings which *themselves* contain bitmaps that you pasted onto a Visio page, then you need to think carefully about the resolution of the pasted-in bitmaps. For example, suppose that you are using Visio to annotate screenshots which will ultimately be printed on a laser printer, resolution 600 dots per inch. If you didn't think about it, you might paste the screenshots into Visio at "normal" screen resolution (96 dpi). But when printed, the 96 dpi does not map onto the printer's 600 dpi evenly, and you get a poor quality print-out. Instead, you should take the screenshot into another package that can set the image's resolution data to say that it's 100 dpi (or perhaps 150 dpi), then paste that into Visio. It will look ugly onscreen, but when printed the 100 or 150 dpi will map evenly to the 600 dpi printer.


Article Created: 2002-08-08 Last edit: Last edit: 02-08-21 Graham Wideman
Go to:
  DiagramAntics.com