I wrote a small WPF app where I like to prepend text into a RichTextBox, so that the newest stuff is on top. I wrote this, and it works:
/// <summary>
/// Prepends the text to the rich textbox
/// </summary>
/// <param name="textoutput">The text representing the character information.</param>
private void PrependSimpleText(string textoutput)
{
Run run = new Run(textoutput);
Paragraph paragraph = new Paragraph(run);
if (this.RichTextBoxOutput.Document.Blocks.Count == 0)
{
this.RichTextBoxOutput.Document.Blocks.Add(paragraph);
}
else
{
this.RichTextBoxOutput.Document.Blocks.InsertBefore(this.RichTextBoxOutput.Document.Blocks.FirstBlock, paragraph);
}
}
Now I would like to make a new version of that function which can add small images as well. I'm at a loss though - is it possible to add images?