diff --git a/Program.cs b/Program.cs index 7b6aeaf..8281025 100644 --- a/Program.cs +++ b/Program.cs @@ -505,14 +505,16 @@ public static class Util { } public static OpenTK.Windowing.Common.Input.Image[] RenderAppIcon() { - Font font = SystemFonts.CreateFont("MS PMincho", 64, FontStyle.Bold); + int size = 64; + Font font = SystemFonts.CreateFont("MS PMincho", size, FontStyle.Bold); TextOptions options = new(font); - Image image = MakeImage(64, 64); + Image image = MakeImage(size, size); IBrush brush = Brushes.Solid(Color.Black); image.Mutate(x => x.DrawText(options, "撮", brush)); - byte[] pixelBytes = new byte[64 * 64 * 4]; + byte[] pixelBytes = new byte[size * size * 4]; image.CopyPixelDataTo(pixelBytes); - OpenTK.Windowing.Common.Input.Image opentkImage = new(64, 64, pixelBytes); + image.Dispose(); + OpenTK.Windowing.Common.Input.Image opentkImage = new(size, size, pixelBytes); return new OpenTK.Windowing.Common.Input.Image[]{ opentkImage }; }