Andrey Bushman
Andrey Bushman

Reputation: 12476

WPF: How can I set image source from DLL resource file?

How can I set image source from DLL resource file?

<Image Source="res/png_32.png" Width="Auto" Height="Auto">

It works fine, but my image are located as resource in the DLL file. How can I get it?

Thank you.

Upvotes: 5

Views: 5618

Answers (1)

Reed Copsey
Reed Copsey

Reputation: 564323

You would handle this via a Pack URI:

<Image Source="pack://application:,,,/TheDLLName;component/res/png_32.png" Width="Auto" Height="Auto">

Upvotes: 4

Related Questions