Windows Store App - RenderTargetBitmap creating a bitmap of incorrect size
<p>I'm attempting to put a watermark on a picture taken by my app. The simplest way I could think of is to use <code>FrameworkElement</code>'s to build the layers and then use <code>RenderTargetBitmap</code> to create the water marked image.</p>

<p>Here is a sample of my XAML.</p>

<pre class="lang-xml prettyprint-override"><code>    &lt;ScrollViewer x:Name="Zoom" Grid.Column="1" HorizontalScrollMode="Enabled" VerticalScrollMode="Enabled" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden" ZoomMode="Enabled"&gt;
        &lt;Border x:Name="BgBorder"&gt;
            &lt;Grid x:Name="ImageGird" SizeChanged="ImageGird_SizeChanged"&gt;
                &lt;Grid x:Name="CaptureGird"&gt;
                    &lt;Image x:Name="CapturedImage" Stretch="None" Source="ms-appx:///Assets/Photo.jpg" /&gt;
                    &lt;StackPanel x:Name="Watermark" VerticalAlignment="Top" HorizontalAlignment="Left" Background="#6FFFFFFF" Margin="10"&gt;
                        &lt;TextBlock Text="Name" Foreground="Black" Margin="10,2.5,10,2.5" /&gt;
                        &lt;TextBlock Text="12345" Foreground="Black" Margin="10,2.5,10,2.5"/&gt;
                        &lt;TextBlock Text="54321" Foreground="Black" Margin="10,2.5,10,2.5" /&gt;
                    &lt;/StackPanel&gt;
                &lt;/Grid&gt;
            &lt;/Grid&gt;
        &lt;/Border&gt;
    &lt;/ScrollViewer&gt;
</code></pre>

<p>Due to resolution of the images they need it is wrapped in a <code>ScrollViewer</code> so it can be zoomed out, however when I attempt to create a bitmap of this image using the below code, the rendered bitmap is smaller then the <code>FrameworkElement</code></p>

<pre class="lang-cs prettyprint-override"><code>private async void Button_Click(object sender, RoutedEventArgs e)
{
    try
    {
        var displayI = DisplayInformation.GetForCurrentView();
        var renderTargetBitmap = new RenderTargetBitmap();
        await renderTargetBitmap.RenderAsync(ImageGird, (int)ImageGird.ActualWidth, (int)ImageGird.ActualHeight);
        IBuffer pixels = await renderTargetBitmap.GetPixelsAsync();
        CapturedImage2.Source = renderTargetBitmap;

        Debug.WriteLine("Button_Click: ImageGrid: " + ImageGird.ActualWidth + "x" + ImageGird.ActualHeight + " RenderTargetBitmap: " + renderTargetBitmap.PixelWidth + "x" + renderTargetBitmap.PixelHeight);
    }
    catch (Exception )
    {
    }
}
</code></pre>

<p>The debug output is</p>

<pre><code>Button_Click: ImageGrid: 5344x3008 RenderTargetBitmap: 4096x2306
</code></pre>

<p>Can anyone tell me why the rendered bitmap is much smaller then the actual element I'm creating it from?</p>

<p>Also is there a better way to watermark an image?</p>