1
我試圖通過每秒設置源屬性來更新圖像,但是這種方式會在更新時導致閃爍。更新BitmapImage每秒閃爍
CurrentAlbumArt = new BitmapImage();
CurrentAlbumArt.BeginInit();
CurrentAlbumArt.UriSource = new Uri((currentDevice as AUDIO).AlbumArt);
CurrentAlbumArt.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
CurrentAlbumArt.EndInit();
如果我不設置IgnoreImageCache
,圖像不因此無論是更新無閃爍。
有沒有辦法解決這個警告?
乾杯。
您可以先下載圖像緩衝區,然後從該緩衝區創建一個MemoryStream,最後創建一個新的BitmapImage並分配其'StreamSource'屬性。 – Clemens
我嘗試過使用BmpBitmapEncoder來做這件事,但它會導致相同的閃爍發生。 – bl4kh4k
爲什麼選擇編碼器?你想解碼圖像。我將提供一些示例代碼。 – Clemens