WPF application. How to reference the image in XAML code, so that another user can view them while executing the .exe file of the project?

0

I'm having a problem with my WPF application. I have two images in the XAML code, and when I run the application on my computer, they appear normal, but when I ask someone to run the .exe file, it runs normally, but the images do not appear. How can I do to set the source images so that when another user runs the .exe file, the images appear on the screen?

The image code in XAML:

<Image Source="\MULINFSV0005\User$\mathias.deitos\Meus Documentos\Visual Studio 2013\Projects\WpfApplication2\WpfApplication2\clock.png" HorizontalAlignment="Left" Height="52" Margin="41,27,0,0" VerticalAlignment="Top" Width="68"/>
    
asked by anonymous 18.12.2014 / 18:46

1 answer

0

You can do this:

If you have a folder with the images in it use it like this:

<Image Source="Imagens\start.png" />

If your image is marked as resource use this way:

<Image Source="Logo.png" />

The two examples above are shortcuts to:

<Image Source="pack://application:,,,/Logo.png" />
<Image Source="pack://application:,,,/Imagens\start.png" />
    
19.12.2014 / 18:03