make icon size a variable
This commit is contained in:
parent
c7ff5ee15d
commit
a67912e1ce
10
Program.cs
10
Program.cs
@ -505,14 +505,16 @@ public static class Util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static OpenTK.Windowing.Common.Input.Image[] RenderAppIcon() {
|
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);
|
TextOptions options = new(font);
|
||||||
Image<Rgba32> image = MakeImage(64, 64);
|
Image<Rgba32> image = MakeImage(size, size);
|
||||||
IBrush brush = Brushes.Solid(Color.Black);
|
IBrush brush = Brushes.Solid(Color.Black);
|
||||||
image.Mutate(x => x.DrawText(options, "撮", brush));
|
image.Mutate(x => x.DrawText(options, "撮", brush));
|
||||||
byte[] pixelBytes = new byte[64 * 64 * 4];
|
byte[] pixelBytes = new byte[size * size * 4];
|
||||||
image.CopyPixelDataTo(pixelBytes);
|
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 };
|
return new OpenTK.Windowing.Common.Input.Image[]{ opentkImage };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user