This commit is contained in:
Paddy
2022-02-13 12:21:06 +01:00
parent d3217a0983
commit b39a58f1b9
9 changed files with 15 additions and 15 deletions

View File

@@ -43,8 +43,8 @@ namespace QuickLook.Plugin.ImageViewer.AnimatedImage.Providers
_fileHandle = (Bitmap) Image.FromFile(path.LocalPath);
_fileHandle.SetResolution(DpiHelper.DefaultDpi * DpiHelper.GetCurrentScaleFactor().Horizontal,
DpiHelper.DefaultDpi * DpiHelper.GetCurrentScaleFactor().Vertical);
_fileHandle.SetResolution(DisplayDeviceHelper.DefaultDpi * DisplayDeviceHelper.GetCurrentScaleFactor().Horizontal,
DisplayDeviceHelper.DefaultDpi * DisplayDeviceHelper.GetCurrentScaleFactor().Vertical);
Animator = new Int32AnimationUsingKeyFrames {RepeatBehavior = RepeatBehavior.Forever};
Animator.KeyFrames.Add(new DiscreteInt32KeyFrame(0, KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(0))));

View File

@@ -104,8 +104,8 @@ namespace QuickLook.Plugin.ImageViewer.AnimatedImage.Providers
if (mi.Width != (int) fullSize.Width || mi.Height != (int) fullSize.Height)
mi.Resize((int) fullSize.Width, (int) fullSize.Height);
mi.Density = new Density(DpiHelper.DefaultDpi * DpiHelper.GetCurrentScaleFactor().Horizontal,
DpiHelper.DefaultDpi * DpiHelper.GetCurrentScaleFactor().Vertical);
mi.Density = new Density(DisplayDeviceHelper.DefaultDpi * DisplayDeviceHelper.GetCurrentScaleFactor().Horizontal,
DisplayDeviceHelper.DefaultDpi * DisplayDeviceHelper.GetCurrentScaleFactor().Vertical);
var img = mi.ToBitmapSourceWithDensity();

View File

@@ -30,8 +30,8 @@ namespace QuickLook.Plugin.ImageViewer
{
// a dirty hack... but is the fastest
var newDpiX = (double) DpiHelper.DefaultDpi * DpiHelper.GetCurrentScaleFactor().Horizontal;
var newDpiY = (double) DpiHelper.DefaultDpi * DpiHelper.GetCurrentScaleFactor().Vertical;
var newDpiX = (double) DisplayDeviceHelper.DefaultDpi * DisplayDeviceHelper.GetCurrentScaleFactor().Horizontal;
var newDpiY = (double) DisplayDeviceHelper.DefaultDpi * DisplayDeviceHelper.GetCurrentScaleFactor().Vertical;
var dpiX = img.GetType().GetField("_dpiX",
BindingFlags.NonPublic | BindingFlags.Instance);