简体   繁体   中英

Resource vs EmbeddedResource which one is preferred for Images?

I have a WPF application which has tons of images. I heard that Build Action - Embedded Resource makes the picture file built into the assembly hence increasing the size it would take in memory to load it.

Is it true ? I am using Mono.Addins project which only supports loading Embedded Resource unless I want to use other methods of discovery + Loading.

Is Embedded Resource bad for images ?

I heard that Build Action - Embedded Resource makes the picture file built into the assembly hence increasing the size it would take in memory to load it.

Actually, both Resource and Embedded Resource cause the image to be embedded in the assembly, but not in the same way. If you want to use the image in a WPF Image control, you need to use Resource . If you use Embedded Resource , you will have to manually extract it and create a WPF ImageSource from it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM