I'm coding software, where I very often need to do graphical illustrations, to explain the behavior of the code, e.g. illustrate geometrically how the shortest distance is found from one of the sides in a triangle to a hit-point in that triangle.
It is getting kind of tedious to use and invent ascii-representations in the comments, so I was thinking if it is possible to embed drawings (pictures created in drawing programs) into the project/solution and link to them in the comment-blocks.
Yes you can. The pictures even don't need to be included in the project. VS will automatically create a clickable link from any URL placed anywhere in the comment. I recommend you to place the URL inside standard <see> comment tag. Our VSdocman supports also the <img> tag that will show the picture directly in generated documentation.
Here is the example that uses both ways. In both cases you can click the link directly in the code editor and the picture will show.
/// <summary>
/// Click <see href="file:///C:\Pictures\Desert.jpg">here</see> to See the picture.
/// </summary>
/// <remarks>Here is the embedded picture:
/// <img src="file:///C:\Pictures\Desert.jpg"/>
/// </remarks>
public void Method1() { }
ImageComments extension for VS 2010/2012 allows images to be displayed amongst code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With