mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
resize bitmapimage when not loading full image
This commit is contained in:
parent
2507d1abed
commit
ba0aee14ba
1 changed files with 6 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
private static IImageHashGenerator _hashGenerator;
|
||||
private static readonly bool EnableImageHash = true;
|
||||
public static ImageSource DefaultImage { get; } = new BitmapImage(new Uri(Constant.MissingImgIcon));
|
||||
public const int SmallIconSize = 32;
|
||||
|
||||
|
||||
private static readonly string[] ImageExtensions =
|
||||
|
|
@ -128,6 +129,11 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
var image = new BitmapImage();
|
||||
image.BeginInit();
|
||||
image.CacheOption = BitmapCacheOption.OnLoad;
|
||||
if (!loadFullImage)
|
||||
{
|
||||
image.DecodePixelHeight = SmallIconSize;
|
||||
image.DecodePixelWidth = SmallIconSize;
|
||||
}
|
||||
image.StreamSource = buffer;
|
||||
image.EndInit();
|
||||
image.StreamSource = null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue