I have a resource item (a png file) in my resource dictionary which I'm using in several places. Now I want to use it as application's NotifyIcon
. But I don't know how to do this. Have you any idea please?
// my image:
var bitmap = new BitmapImage();
bitmap.UriSource = new Uri("pack://application:,,,/MyProj.Resources;component/Icons/Logo_48x48.png");
// and I try to do this:
var iconHandle = bitmap.GetHicon(); // but this line doesn't work
var ni = new NotifyIcon {
Icon = System.Drawing.Icon.FromHandle(iconHandle),
Visible = true
};