June 03, 2003

Ink tool for Visual Studio .NET

I've been thinking about saving sketches of data structures and quick notes with the source code of programs. It's a little bit Knuthish, but I'm curious to see what the experience is like.

I'm beginning to settle around an approach that I have yet to implement, but I wonder what others may suggest or have tried, so here goes.

I've been experimenting with Visual Studio .NET's Addins and it's simple enough to add a Tool window although I haven't gone the extra step of creating an ink-enabled window yet. I'm thinking about embedding the ink drawings from the window in the source code as commented out <svg> documents:

/// <svg width="300" height="200">
/// <path id="stroke1" style=...
/// </svg>

Visual Studio does a nice job of collapsing these commented blocks, so hopefully the statements would not be too obtrusive when working with the source code.

VisualStudioInkAddin.gif I figure that when the cursor visits an svg block, its drawing can be extracted and rendered in the ink-enabled tool window. A mockup is shown at right.

The commented svg sections concern me a little. I'm not sure how the parsing will work out in the generic case. (Hmmm. Too bad C# isn't designed so that XML-based subdocuments--such as an svg document, XML fact or other piece of knowledge--can be placed within the source code as first class constructs.)

I'm thinking of embedding small svg documents. I'm not sure about storing and displaying larger svg drawings, screenshots, UML diagrams, or output from programs such as Rigi. These are probably better saved externally from the source code.

I'm probably overlooking something. If you see it, let me know.

Posted by Loren at June 3, 2003 02:10 PM
Comments

Hello Loren,


This idea is very interesting! I am also too playing with ink and SVG and trying to find out how to user the two together, I created a sample control what can render ink into svg (http://www.tabletpcdeveloper.com/userarea/filedetails.aspx?FileName=InkSVG.zip) and one where you can post this svg to a blog site (http://www.tabletpcdeveloper.com/userfiles/gyurisc/InkBlogger.zip).


for the parsing you might want to try out this library called SVG# it looks really promising!

Cris

Posted by: Krisztian Gyuris on June 4, 2003 01:53 AM

It's easy to create a tool window add in??? I must be missing the documentation bits. :) Cause all the documentation I saw about AddIns required me to implement a COM interface to create a tool window..

Can you point me in the right direction??

Thanks ;)

Posted by: marauderz on June 4, 2003 02:29 AM

Ink can natively be persisted to 2 main formats: binary (Ink Serialized Format) and gif. The gif format displays the ink, but also stores the actual ink information in an extension of the gif format.

Although I don't like these formats because they aren't open, they both would fit your needs, as they can be base64 encoded for inclusion within text content (xml or other).

The gif format would even allow non VS.net to display the "ink comment" on ink-unaware platforms.

Cheers
Dumky

Posted by: Dumky on June 4, 2003 12:27 PM

Yep, marauderz, sounds like I'm using the same material you are from MSDN/www.microsoft.com samples and www.codeproject.com. I read through a few chapters of a couple Visual Studio .NET books too, although I didn't ultimately use any of their code, but it did help my understanding of the MS sample code and the apps on codeproject.

Posted by: Loren on June 5, 2003 10:26 AM

Cris, thanks for the link. Nice job.

I like SVG too because you can share ink via a web browser. However--at least in my SVG viewer--I can't select part of a rendering; I can only copy-paste the whole SVG document. It would be nice to be able to copy-paste a couple lines from an inked blog post, for instance.

Posted by: Loren on June 5, 2003 10:45 AM
Post a comment