WPF - Import image as resource

后端 未结 3 976
醉梦人生
醉梦人生 2020-11-22 06:42

In WinForms it is possible to import an image as a resource, and the image would still work when compiled in the /bin/Debug folder.

I can\'t figure out how to get t

3条回答
  •  醉梦人生
    2020-11-22 07:31

    1. Add the image to your project directory
    2. In the solutions explorer, right click the image and select Include in Project

    Build Action should be set to Resource by default.

    You can then start to use the image path relative to the root e.g. images/text.jpg if you put it in a folder called images.

提交回复
热议问题