You can export sketches in two formats: bitmap or metafile. Bitmaps are raster images with a fixed pixel size. Metafiles are vector images that scale up or down to fit the resolution of the device it's drawn to. Both have their uses. Here is a meaningless sketch containing lots of different kinds of objects:

Here is that sketch exported to a bitmap:

To export your sketch as a bitmap, use the MakeBitmap method. When you do so, you'll have to specify a target resolution in terms of dots-per-inch (DPI). If you plan to use the bitmap on a screen, then 96 DPI is a good number. If you plan to print the bitmap, then 600 DPI is better, though be warned that your bitmap file will be very large at that resolution or higher.

To export your sketch as a metafile, use the MakeMetaFile method. Metafiles are small in size yet scale up to high resolution devices nicely, but they can be a little harder to get the aspect ratio to match exactly what you had in the sketch control.

OIPI supports either bitmaps or metafiles, so choose whatever makes sense to your project.

Reading & Writing

Exporting your images are useful, but you'll also want to save your sketches in their native format. This is done using the Data property. When you read this property, you will get a long base64 encoding string. This makes it convenient for storing your sketch anywhere in the OpenInsight database. When it's time to load a previously saved sketch, just pass that base64 string back into the Data property and you're all set.

  • No labels