private ImageSource GetEmbeddedImage(System.Reflection.Assembly app, string imageName) { System.IO.Stream file = app.GetManifestResourceStream("BIMSource.NewSPWriter." + imageName); PngBitmapDecoder bd = new PngBitmapDecoder(file, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); return bd.Frames[0]; }