Core - Add ResourcePackImporter.cs

This commit is contained in:
miku-666
2025-12-02 19:20:35 +01:00
parent 440dadec35
commit 8a8c4330fd
28 changed files with 3384 additions and 126 deletions

View File

@@ -142,12 +142,13 @@ namespace PckStudio.Core.Extensions
using (var graphic = Graphics.FromImage(image))
{
graphic.ApplyConfig(GraphicsConfig.PixelPerfect());
foreach ((int i, Image texture) in sources.enumerate())
{
int x = Math.DivRem(i, columns, out int y);
if (horizontal)
y = Math.DivRem(i, rows, out x);
graphic.DrawImage(texture, new Point(x * texture.Width, y * texture.Height));
graphic.DrawImage(texture, new Rectangle(new Point(x * texture.Width, y * texture.Height), texture.Size));
}
}
return image;