Skip to content

Commit 638f108

Browse files
Update
1 parent ef88d39 commit 638f108

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ArcanumTextureSlicer.exe bmp-file output-folder
Binary file not shown.
191 KB
Loading
470 KB
Binary file not shown.

ArcanumTextureSlicer/ArcanumTextureSlicer/Program.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ public static void Main(string[] args)
3939
{
4040
try
4141
{
42-
Console.WriteLine($"Save tile #{j},{i}.");
43-
outputBitmap.Save($"{outputFolder.TrimEnd('/', '\\')}\\tile_{j}_{i}.bmp",
44-
ImageFormat.Bmp);
42+
var tilePath =
43+
$"{outputFolder.TrimEnd('/', '\\')}\\tile_{LeadingZero(j)}_{LeadingZero(i)}.bmp";
44+
Console.WriteLine(tilePath);
45+
outputBitmap.Save(tilePath, ImageFormat.Bmp);
4546
}
4647
catch (Exception e)
4748
{
@@ -57,5 +58,14 @@ public static void Main(string[] args)
5758
Console.WriteLine(e);
5859
}
5960
}
61+
62+
private static string LeadingZero(int i)
63+
{
64+
return i < 100
65+
? i < 10
66+
? $"00{i}"
67+
: $"0{i}"
68+
: $"{i}";
69+
}
6070
}
6171
}

0 commit comments

Comments
 (0)