Merge pull request #120 from Storyteller-Studios/dev

chores: Force Dpi to 96
This commit is contained in:
Zhe Fang
2025-10-24 07:10:48 -04:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@@ -201,7 +201,7 @@ namespace BetterLyrics.WinUI3.Helper
var result = await GetAccentColorAsync(decoder, generatorType); var result = await GetAccentColorAsync(decoder, generatorType);
var color = Windows.UI.Color.FromArgb(255, (byte)result.Color.X, (byte)result.Color.Y, (byte)result.Color.Z); var color = Windows.UI.Color.FromArgb(255, (byte)result.Color.X, (byte)result.Color.Y, (byte)result.Color.Z);
using var renderTarget = new CanvasRenderTarget(device, size, size, canvasBitmap?.Dpi ?? 96); using var renderTarget = new CanvasRenderTarget(device, size, size, 96);
int offsetX = (int)(size - decoder.PixelWidth) / 2; int offsetX = (int)(size - decoder.PixelWidth) / 2;
int offsetY = (int)(size - decoder.PixelHeight) / 2; int offsetY = (int)(size - decoder.PixelHeight) / 2;

View File

@@ -56,6 +56,8 @@ namespace BetterLyrics.WinUI3.Services.MediaSessionsService
token.ThrowIfCancellationRequested(); token.ThrowIfCancellationRequested();
var albumArtSwBitmap = await decoder.GetSoftwareBitmapAsync(BitmapPixelFormat.Rgba8, BitmapAlphaMode.Premultiplied); var albumArtSwBitmap = await decoder.GetSoftwareBitmapAsync(BitmapPixelFormat.Rgba8, BitmapAlphaMode.Premultiplied);
albumArtSwBitmap.DpiX = 96;
albumArtSwBitmap.DpiY = 96;
token.ThrowIfCancellationRequested(); token.ThrowIfCancellationRequested();
var albumArtLightAccentColors = await ImageHelper.GetAccentColorsAsync(decoder, 4, _liveStatesService.LiveStates.LyricsWindowStatus.LyricsBackgroundSettings.PaletteGeneratorType, false); var albumArtLightAccentColors = await ImageHelper.GetAccentColorsAsync(decoder, 4, _liveStatesService.LiveStates.LyricsWindowStatus.LyricsBackgroundSettings.PaletteGeneratorType, false);