Okay, I guess it works perfect for everything but images. When I do this and my markup includes images, the image is scaled to a very big size, for some reason. The image is simply an icon (16x16) and yet it's blown up to fill the entire area. I looked in the documentation, but as far as I can tell, there's no way to specify a height or a width. This can be produced very easily with a ContentProvider in a Window and an HtmlContentProvider implementation like this one:
public class HtmlContentProviderExt : HtmlContentProvider
{
public HtmlContentProviderExt(string htmlSnippet) : base(htmlSnippet) { }
protected override Image GetImage(string source)
{
Image img = new Image();
BitmapImage bmpImg = new BitmapImage();
bmpImg.BeginInit();
bmpImg.UriSource = new Uri("pack://application:,,,/ActiproImageSizeIssue;component" + source);
bmpImg.EndInit();
img.Source = bmpImg;
return img;
}
}
I use it like this:
HtmlContentProviderExt provider = new HtmlContentProviderExt("<img src=\"/accept.png\" />");
cpTest.Content = provider.GetContent();
This is not a problem when I use it with e.g. QuickInfo, but perhaps that's because the control used there is limited in height? In this case I need to be able to span the content for several lines and therefore have the images show up in their actual size (16x16 in this situation). What to do? :)