title: How to add a URI path to a bitmap image?
body: <p>I'm creating a bitmap image from a local image file to overlay on another bitmap, but when specify the file URI I get a <code>System.UriFormatException</code> which I cant understand as the image is stored in a folder named Images in the project which seems correct. This is how I specified the URI <code>new Uri("Images/boxbag.png")</code>. Can someone explain why I'm getting this format exception,is it a problem with the file path or the way in which I set up the URI.</p>
  
  <p>This is the complete method below which should clarify things more:</p>
  
  <pre><code>void myKinect_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e) {
      using (ColorImageFrame colorFrame = e.OpenColorImageFrame()) {
          if (colorFrame == null) return;
          byte[] colorData = new byte[colorFrame.PixelDataLength];
          colorFrame.CopyPixelDataTo(colorData);
  
          KinectVideo.Source = BitmapSource.Create(colorFrame.Width, colorFrame.Height, 96, 96,
              PixelFormats.Bgr32, null, colorData, colorFrame.Width * colorFrame.BytesPerPixel);
  
          //drawing image overlay to video feed
          var drawingVisual = new DrawingVisual();
          var drawingContext = drawingVisual.RenderOpen();
          drawingContext.DrawImage(BitmapSource.Create(colorFrame.Width, colorFrame.Height, 96, 96, PixelFormats.Bgr32, null, colorData, colorFrame.Width * colorFrame.BytesPerPixel), 
              new Rect(new Size(colorFrame.Width, colorFrame.Height)));
          var overlayImage = new BitmapImage(new Uri("Images/boxbag.png"));
          drawingContext.DrawImage(overlayImage, new Rect(12, 12, overlayImage.Width, overlayImage.Height));
          drawingContext.Close();
          var mergedImage = new RenderTargetBitmap(colorFrame.Width, colorFrame.Height, 96, 96, PixelFormats.Pbgra32);
          mergedImage.Render(drawingVisual);
  
          KinectVideo.Source = mergedImage;
      }
  }
  </code></pre>