mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
Bugfix for issue #397
Wallpaper is not cached in Wox's memory, so that the wallpaper file remains unlocked
This commit is contained in:
@@ -425,7 +425,12 @@ namespace Wox
|
||||
var wallpaper = WallpaperPathRetrieval.GetWallpaperPath();
|
||||
if (wallpaper != null && File.Exists(wallpaper))
|
||||
{
|
||||
var brush = new ImageBrush(new BitmapImage(new Uri(wallpaper)));
|
||||
var memStream = new MemoryStream(File.ReadAllBytes(wallpaper));
|
||||
var bitmap = new BitmapImage();
|
||||
bitmap.BeginInit();
|
||||
bitmap.StreamSource = memStream;
|
||||
bitmap.EndInit();
|
||||
var brush = new ImageBrush(bitmap);
|
||||
brush.Stretch = Stretch.UniformToFill;
|
||||
PreviewPanel.Background = brush;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user