Reputation: 2593
I have seen several examples like
How to Set Image Resource URI from Code-Behind
but haven't understood.
If I have the following solution
I want to set the uri for ita.png
Stream iconStream = Application.GetResourceStream(new Uri(?????)).Stream;
notifyIcon.Icon = new System.Drawing.Icon(iconStream);
thanks
Upvotes: -1
Views: 358
Reputation: 1491
You can use pack URI syntax described here
In your case it would be something like this:
Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/Resources/Images/ITA.png")).Stream;
notifyIcon.Icon = new System.Drawing.Icon(iconStream);
Upvotes: 1