only My site

Wednesday, January 5, 2011

using System.Drawing;
using System.Reflection;
using System.IO;

//Decleration
Assembly _assembly;
Stream _imageStream;


//Option 1
Uri iconUri = new Uri("pack://application:,,,/favicon.ico", UriKind.RelativeOrAbsolute);
this.Icon = BitmapFrame.Create(iconUri);

//Option 2
_assembly = Assembly.GetExecutingAssembly();
_imageStream = _assembly.GetManifestResourceStream("EdwardsMbt.ClientApp.favicon.ico");

this.Icon = BitmapFrame.Create(_imageStream);

No comments: