Attaching Images to a CHM Help File Using Sandcastles

I am using Sandcastles to create a CHM help file for my project. I want a separate CHM file that I can distribute, preferably on my own.

The problem is that for embedding images, it seems that the image must exist in the user system separately from the CHM file. When I look at the source of my CHM file, it looks like this:

<img src="C:\Users\me\Pictures\wave.jpg" />

So, if I email my CHM file to someone and they don’t have this image, it will not work. An alternative could be:

<img src="images/wave.jpg" />

And write this person a ZIP containing my CHM file and image folder. This is not a very pleasant solution, in my opinion.

Is there a way to β€œinsert” an image into a CHM file? Or is there a clean solution for this?

For the record, I include this image through this XML code in my C # project.

/// <summary>
/// Lorem ipsum dolor sit amet, consectetur adipiscing elit.
/// Pellentesque quis tortor sit amet magna posuere sagittis. 
/// Integer aliquet nibh elit, ut porta ex laoreet et
/// </summary>
/// /// <remarks>A picture: <br />
/// <img src "C:\Users\me\Pictures\wave.jpg" />
/// </remarks>
+4
source share
1 answer

This is just a sample of Visual Basic, but I think C # is nearby. I assume that you are using Sandboxle Help File Builder (SHFB).

If the images are not used in the MAML sections, simply set the BuildAction in the SHFB project to Content and place them in the image folder. They will be automatically copied to the working folder and compiled into the CHM help file.

The steps to import the [images] folder into the SHFB Project Explorer that are not referenced by MAML themes:

  • Select "Add and existing folder ... from the context menu of the tree", select [images] -Folder
  • BuildAction
  • SHFB " "

CHM .

Visual Basic, SHFB CHM.

enter image description here

enter image description here

enter image description here

+7

All Articles