title: X,Y coordinates for WriteableBitmap and GestureListener_Tap do not match - Windows Phone 8
body: <p>I am creating a hidden object game and am trying to mark the object when found with an eclipse. I've manually saved the top left and bottom right coordinates of each picture which were obtained via the GestureListener_Tap event. </p>
  
  <p>The problem is when I tried to draw an eclipse bounded by the coordinates using this code</p>
  
  <pre><code>WriteableBitmapExtensions.DrawEllipse(writeableBmp, AnsX1, AnsY1, AnsX2, AnsY2, Colors.Red);
  </code></pre>
  
  <p>The location of the eclipse is always off to the top left. Marking the pixel locations using the following codes show that they are indeed located differently then what I would expect from the GestureListener_Tap.</p>
  
  <pre><code>writeableBmp.SetPixel(AnsX1, AnsY1, Colors.Red);
  writeableBmp.SetPixel(AnsX2, AnsY2, Colors.Red);
  </code></pre>
  
  <p>My code for marking the location:</p>
  
  <pre><code>    private void fadeOutAnimation_Ended(object sender, EventArgs e)
      {
  
          WriteableBitmap writeableBmp = new WriteableBitmap(bmpCurrent);
          imgCat.Source = writeableBmp;
          writeableBmp.GetBitmapContext();
  
          WriteableBitmapExtensions.DrawEllipse(writeableBmp, AnsX1, AnsY1, AnsX2, AnsY2, Colors.Red);
          writeableBmp.SetPixel(AnsX1, AnsY1, Colors.Red);
          writeableBmp.SetPixel(AnsX2, AnsY2, Colors.Red);
  
          // Present the WriteableBitmap
          writeableBmp.Invalidate();       
  
          //Just some animation code
          RadFadeAnimation fadeInAnimation = new RadFadeAnimation();
          fadeInAnimation.StartOpacity = 0.2;
          fadeInAnimation.EndOpacity = 1.0;
          RadAnimationManager.Play(this.imgCat, fadeInAnimation);
  
      }
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p>EDIT:</p>
  
  <p>My answer below does not take into account the screen orientation changed. See my comment below the answer. How do you map pixel coordinates to image coordinate?</p>
  
  <p>EDIT 2:</p>
  
  <p>Found a correct solution. Updated my answer</p>