-1

i have this small problem,i have an WPF executable with lots of images,and it loads only on local computer (on the one the exe was made) the rest of computers see only text,no imgs,i saw that the imgs url are on the local's computers,so my question is : how can i load them from the images image? as it gives the error : property value is not valid everytime i select the images from the Images dir from source.

Catalin Mihai
  • 107
  • 1
  • 1
  • 6

1 Answers1

1

If just shown on development PC then you need either add them as embedded resources or make sure to copied them into the assembly folder before deployment.

Community
  • 1
  • 1
Erre Efe
  • 15,387
  • 10
  • 45
  • 77
  • void LoadImages() { BitmapImage myImage = new BitmapImage(new Uri(@"9XFfD.png", UriKind.RelativeOrAbsolute)); } – Catalin Mihai Sep 19 '12 at 15:33
  • @CatalinMihai Independent of how you are displaying the image (using XAML or C#) the problem is with the path to the image. Look on google how to add embedded resources into your wpf project and do it that way. – Erre Efe Sep 19 '12 at 16:06