Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

wpf

xaml

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.

like image 641
Andrey Bushman Avatar asked Oct 03 '22 05:10

Andrey Bushman


1 Answers

You would handle this via a Pack URI:

<Image Source="pack://application:,,,/TheDLLName;component/res/png_32.png" Width="Auto" Height="Auto">
like image 97
Reed Copsey Avatar answered Oct 13 '22 10:10

Reed Copsey