From 4a7ba0b4a46008f965803d12f12b36160ee78e70 Mon Sep 17 00:00:00 2001 From: VladiStep Date: Thu, 2 Jun 2022 22:14:26 +0300 Subject: [PATCH 1/2] Fixed QOI textures display on different system display scale; embedded texture and texture item preview looks sharp --- UndertaleModLib/Util/QoiConverter.cs | 1 + UndertaleModTool/Editors/UndertaleEmbeddedTextureEditor.xaml | 3 ++- UndertaleModTool/Editors/UndertaleTexturePageItemEditor.xaml | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/UndertaleModLib/Util/QoiConverter.cs b/UndertaleModLib/Util/QoiConverter.cs index 9aeadaf88..369dfee9c 100644 --- a/UndertaleModLib/Util/QoiConverter.cs +++ b/UndertaleModLib/Util/QoiConverter.cs @@ -69,6 +69,7 @@ public unsafe static Bitmap GetImageFromSpan(ReadOnlySpan bytes, out int l ReadOnlySpan pixelData = bytes.Slice(12, length); Bitmap bmp = new Bitmap(width, height, PixelFormat.Format32bppArgb); + bmp.SetResolution(96.0f, 96.0f); BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); if (data.Stride != width * 4) diff --git a/UndertaleModTool/Editors/UndertaleEmbeddedTextureEditor.xaml b/UndertaleModTool/Editors/UndertaleEmbeddedTextureEditor.xaml index 1a420e640..e08acb4a7 100644 --- a/UndertaleModTool/Editors/UndertaleEmbeddedTextureEditor.xaml +++ b/UndertaleModTool/Editors/UndertaleEmbeddedTextureEditor.xaml @@ -36,7 +36,8 @@ - + diff --git a/UndertaleModTool/Editors/UndertaleTexturePageItemEditor.xaml b/UndertaleModTool/Editors/UndertaleTexturePageItemEditor.xaml index 7219db7a0..c5b33abf6 100644 --- a/UndertaleModTool/Editors/UndertaleTexturePageItemEditor.xaml +++ b/UndertaleModTool/Editors/UndertaleTexturePageItemEditor.xaml @@ -91,7 +91,8 @@