摘要:
网上查到的代码,多数的写法使用MemoryStream来实现: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(); } t 阅读全文