title: When changing the program size, the image box should automatically expand
body: <p>I have a program size and if I increase this at the corners is to increase the ImageBox automatically with.Unfortunately, this does not work yet, since an error occurs.Has anyone a solution to this, if I change the form size, which also increases the ImageBox automatically.I would like the size of the ImageBox then also larger, if I change the size of the form.</p>
  
  <pre><code>private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
              {
                  imgPreview.Source = zoom(imgPreview, new System.Drawing.Size(Convert.ToInt32(this.Width), Convert.ToInt32(this.Height))); // Mistake is here
              }
  </code></pre>
  
  <hr>
  
  <pre><code>        System.Drawing.Image zoom(System.Drawing.Image img, System.Drawing.Size size)
          {
              Bitmap bmp = new Bitmap(img, img.Width + (img.Width * size.Width / 100), img.Height + (img.Height * size.Height / 100));
              Graphics g = Graphics.FromImage(bmp);
              g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
              return bmp;
          }
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;UserControl x:Class="Vorschau.UCOxyplotPreview"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               xmlns:local="clr-namespace:Vorschau"
               mc:Ignorable="d" Height="379.573" Width="539.634" SizeChanged="UserControl_SizeChanged"&gt;
      &lt;Image x:Name="imgPreview" HorizontalAlignment="Left" Height="350" Margin="109,20,0,0" VerticalAlignment="Top" Width="350"/&gt;
  
  &lt;/UserControl&gt;
  </code></pre>