I\'m using a winforms webbrowser control to display some content in a windows forms app. I\'m using the DocumentText property to write the generated HTML. That part is wor
Here's what we do, although I should mention that we use a custom web browser to remove such things as the ability to right-click and see the good old IE context menu:
public class HtmlFormatter
{
///
/// Indicator that this is a URI referencing the local
/// file path.
///
public static readonly string FILE_URL_PREFIX =
"file://";
///
/// The path separator for HTML paths.
///
public const string PATH_SEPARATOR = "/";
}
// We need to add the proper paths to each image source
// designation that match where they are being placed on disk.
String html = HtmlFormatter.ReplaceImagePath(
myHtml,
HtmlFormatter.FILE_URL_PREFIX + ApplicationPath.FullAppPath +
HtmlFormatter.PATH_SEPARATOR);
Basically, you need to have an image path that has a file URI, e.g.