Assign BitmapImage from Resources.resx to Image.Source?

前端 未结 1 1428
星月不相逢
星月不相逢 2020-11-22 14:40

I would like to assign a BitmapImage from my Resources.resx to an Image. Beforehand I saved a .png image to Resources.resx. This image is now locat

相关标签:
1条回答
  • 2020-11-22 15:01

    In order to make that Uri work, the file logo.png must be contained in a folder named "Resources" in your VS project (see first image), and its Build Action must be set to Resource (see second image).

    VS Project

    Build Action

    This Resources folder is completely unrelated to Resources.resx. You may rename it to whatever you like.

    0 讨论(0)
提交回复
热议问题