fahadash
fahadash

Reputation: 3281

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 ?

Upvotes: 0

Views: 854

Answers (1)

Thomas Levesque
Thomas Levesque

Reputation: 292425

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.

Upvotes: 5

Related Questions