According to http://msdn.microsoft.com/en-us/library/z6c2z492%28v=vs.110%29.aspx:
This constructor assumes that the string parameter references an absolute URI and is equivalent to calling the Uri constructor with UriKind set to Absolute. If the string parameter passed to the constructor is a relative URI, this constructor will throw a UriFormatException.
First, try to use an absolute path to see if everything works in principle.
If it works, you can try to find the application path, e.g. with help of System.AppDomain.CurrentDomain.BaseDirectory
, and construct an absolute path to the image using application path and the relative path from the application path to the image.
Something like the following:
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
string imageRelativePath = "...";
string imagePath = Path.Combine(baseDirectory, imageRelativePath);