new Thread(new ThreadStart(() => {
var bitmap = new BitmapImage();
bitmap.BeginInit();
using (var stream = new MemoryStream(File.ReadAllBytes(...))) {
bitmap.StreamSource = stream;
bitmap.CacheOption = BitmapCacheOption.OnLoad;
bitmap.EndInit();
bitmap.Freeze();
}
this.Dispatcher.Invoke((Action)delegate {
Image1.Source = bitmap;
});
})).Start();
using (var stream = new FileStream(path, FileMode.Open)) {
image.BeginInit();
image.StreamSource = stream;
image.DecodePixelWidth = 100;
image.CacheOption = BitmapCacheOption.OnLoad;
image.EndInit();
image.Freeze();
}