C# WPF Load images from the exe folder

后端 未结 2 1997
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-21 06:20

i want to move my program from a pc to another but the problem is the images are not loaded on any other pc (Source problem) . So i was wondering if i could just create a fo

2条回答
  •  甜味超标
    2020-12-21 06:34

    You could do something like this:

    Source="pack://siteoforigin:,,,/Images/someimage.png"  
    

    and use images off of your bin/app folder. Take a look at this link for more info...

    Custom graphic in WPF application?

    What is application's site of origin and when to use it

提交回复
热议问题