I am trying to get an image from my projects resources and convert it to a Picture in a n WPF application, however when i get to the image I get a path that i cannot follow. ("P:\Projects\DocumentHandling\PictureHandler\bin\Debug\DocumentHandlingTouch.exe\..\..\Resources\pdf1.jpg") The picture does not show up. Othe images using the code below show up, just not the one from the resources portion.
Picture p = new Picture();
t.Content = filePath.Value;
p.ToolTip = t;
//External Program
if (Path.GetExtension(filePath.Key.ToString()) == ".pdf")
{
var path = System.Reflection.Assembly.GetExecutingAssembly().Location + @"\..\..\Resources\pdf1.jpg";
p.ImagePath = path;
}
Is my path setup wrong in there? i need to display this image whenever a pdf file is needed. The program shows pictures from a database. but if its a pdf, obviously it wont show anything, so i'd like to show the image for it.