title: Adding an image inside a RichTextBox WPF
body: <p>I'm trying to add a static image inside a <code>RichTextBox</code> based on the selection of a ListBox item. I'm able to achieve the functionality of loading the image but the image doesn't occupy the entire size of the <code>RichTextBox</code>. I looked at MSDN documentation for any property I could set but couldn't find any that suits my need.</p>
  
  <p>I've posted a sample code snippet to add an image to a <code>RichTextBox</code>.</p>
  
  <pre><code>&lt;Window x:Class="ImageDepth.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="MainWindow" Height="350" Width="525"&gt;
  &lt;Grid&gt;
      &lt;RichTextBox HorizontalAlignment="Center" Height="100" VerticalAlignment="Center" Width="100" BorderBrush="Gray"&gt;
          &lt;FlowDocument&gt;
              &lt;BlockUIContainer&gt;
                  &lt;Image Source="C:\Temp\Penguins.jpg"/&gt;
              &lt;/BlockUIContainer&gt;                
          &lt;/FlowDocument&gt;
      &lt;/RichTextBox&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>Am I missing something here or is there a simpler way to achieve this?</p>
  
  <p><strong>Edit:</strong> I tried setting the Height and Width of the Image to that of the <code>RichTextBox</code> but it covers about 80% of the <code>RichTextBox</code>. Also, I had to remove the Stretch property of the Image since it distorts the image slightly even though setting the property makes the image cover about 90% of the area.</p>