title: WPF Image Collison Detection
body: <p>I have some code which detects collision ;</p>
  
  <pre><code>public bool DetectCollision(ContentControl ctrl1, ContentControl ctrl2)
  {
  
      Rect ctrl1Rect = new Rect(
          new Point(Convert.ToDouble(ctrl1.GetValue(Canvas.LeftProperty)),
                    Convert.ToDouble(ctrl1.GetValue(Canvas.TopProperty))),
          new Point((Convert.ToDouble(ctrl1.GetValue(Canvas.LeftProperty)) + ctrl1.ActualWidth),
                    (Convert.ToDouble(ctrl1.GetValue(Canvas.TopProperty)) + ctrl1.ActualHeight)));
  
      Rect ctrl2Rect = new Rect(
          new Point(Convert.ToDouble(ctrl2.GetValue(Canvas.LeftProperty)),
                    Convert.ToDouble(ctrl2.GetValue(Canvas.TopProperty))),
          new Point((Convert.ToDouble(ctrl2.GetValue(Canvas.LeftProperty)) + ctrl2.ActualWidth),
                    (Convert.ToDouble(ctrl2.GetValue(Canvas.TopProperty)) + ctrl2.ActualHeight)));
  
      ctrl1Rect.Intersect(ctrl2Rect);
      return !(ctrl1Rect == Rect.Empty);
  }
  </code></pre>
  
  <p>It detects when 2 rectangles are over. There are images in the given parameter ContentControls. I want to be able to detect if those images intersects not the rectangels. Following images shows whatn I want ;</p>
  
  <p><img src="https://i.stack.imgur.com/CWQfc.png" alt="Not Collution"></p>
  
  <p><img src="https://i.stack.imgur.com/ikurI.png" alt="that&#39;s what I want to"></p>