0

Goal:
Display a picture, that is saved inside of my application, in my document.

Problem:
How do retrieve the URL addres of logotype.jpg picture that is located inside of my application? The picture is saved inside of my WPF application.

The address should be used in the class Uri.

enter image description here

Bart
  • 19,692
  • 7
  • 68
  • 77
HelloWorld1
  • 13,688
  • 28
  • 82
  • 145
  • Could you expand on your question. You already have the URL as you're displaying the image with instantiation of BitmapImage. – mservidio Aug 06 '11 at 16:15
  • Oh, I see it's in a different class library. Set logotype.jpg as content, then find the executing assembly path, and build the path for the image... – mservidio Aug 06 '11 at 16:19

2 Answers2

0

Set logotype.jpg as content and copy always/copy if newer, then find the executing assembly path, and build the path for the image...

How can I get the application's path in a .NET console application?

Also, you might be able to also add the image as a resource and reference it un the resource bundle.

Community
  • 1
  • 1
mservidio
  • 12,817
  • 9
  • 58
  • 84
0

The address to resources is in the pack URI format, in this case (if the build option is Resource, that's what i would take "saved inside the application" for) it would be:

pack://application:,,,/Pictures/logotype.jpg
H.B.
  • 166,899
  • 29
  • 327
  • 400