Mouse Position and Canvas.SetLeft
<p>I am trying to set a Image to a specific location on my application. I get the position that I want to set via <code>Mouse.GetPosition</code>. However, this position is not correct when I try to use <code>Canvas.SetLeft</code>. How can I set it to the position I want? </p>

<p>Note: This is a dynamically created Image Control onto a Canvas named SI, and XC[0] is the X coordinates that I got from Mouse.GetPosition.</p>

<pre><code>var webimage = new BitmapImage(new Uri("C:\\Class16\\Images\\DSC_0000.jpg"));
            var imageControl = new Image();
            imageControl.Source = webimage;
            imageControl.Width =(XC[3] - XC[0]);
            imageControl.Height = (YC[1] - YC[0]);
            Canvas.SetLeft(imageControl, XC[0]);
            SI.Children.Add(imageControl);
</code></pre>

<p>And codes for getting the mouse position</p>

<pre><code>private void Image_Frame_MouseDown(object sender, MouseButtonEventArgs e)
    {
        if (XC[3] == 0)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                if (DIP.Default.Image1BR == 0)
                {
                    Point position = e.GetPosition(this);
                    XC[variant] = position.X;
                    YC[variant] = position.Y;
                    variant++;
                }
            }
        }}
</code></pre>

<p>And if it helps, this is the Canvas Xaml portion.</p>

<pre><code>&lt;Canvas x:Name="SI" Height="380" Width="720" Canvas.Left="177" Canvas.Top="31"&gt;
        &lt;Image x:Name="Image_Frame" Height="380" Width="720" Drop="Image_Frame_Drop" AllowDrop="True" MouseDown="Image_Frame_MouseDown" /&gt;
    &lt;/Canvas&gt;
</code></pre>
