Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 57 additions & 1 deletion UoFiddler.Controls/UserControls/AnimationListControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 89 additions & 0 deletions UoFiddler.Controls/UserControls/AnimationListControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,95 @@ private void ExportSingleFrame(ImageFormat imageFormat)
}
}

private void OnClickExportAllThumbnailsBmp(object sender, EventArgs e)
{
ExportAllThumbnails(ImageFormat.Bmp);
}

private void OnClickExportAllThumbnailsTiff(object sender, EventArgs e)
{
ExportAllThumbnails(ImageFormat.Tiff);
}

private void OnClickExportAllThumbnailsJpg(object sender, EventArgs e)
{
ExportAllThumbnails(ImageFormat.Jpeg);
}

private void OnClickExportAllThumbnailsPng(object sender, EventArgs e)
{
ExportAllThumbnails(ImageFormat.Png);
}

private void ExportAllThumbnails(ImageFormat imageFormat)
{
if (_listViewGraphics.Count == 0)
{
return;
}

string thumbnailPath = Path.Combine(Options.AppDataPath, "thumbnails");
if (!Directory.Exists(thumbnailPath))
{
Directory.CreateDirectory(thumbnailPath);
}

string what = _displayType == 1 ? "Equipment" : "Mob";
string fileExtension = Utils.GetFileExtensionFor(imageFormat);

using (new WaitCursorScope(this))
using (new ProgressBarDialog(_listViewGraphics.Count, $"Export to {fileExtension}", false))
{
for (int i = 0; i < _listViewGraphics.Count; ++i)
{
ControlEvents.FireProgressChangeEvent();
Application.DoEvents();

int graphic = _listViewGraphics[i];
int action = ((int[])_listViewNodes[i].Tag)[2];
if (action < 0)
{
action = 0;
}

int hue = 0;
// Cache-owned bitmap — clone before saving, never save/dispose it directly.
Bitmap sourceBitmap = Animations.GetAnimation(graphic, action, 1, ref hue, false, true)?[0].Bitmap;
if (sourceBitmap == null)
{
continue;
}

string fileName = Path.Combine(thumbnailPath, $"{what} {Utils.FormatExportId(graphic)}.{fileExtension}");

if (imageFormat == ImageFormat.Png)
{
// Only Png preserves transparency - clone as-is instead of flattening onto white.
using (Bitmap bit = new Bitmap(sourceBitmap))
{
bit.Save(fileName, imageFormat);
}

continue;
}

using (Bitmap newBitmap = new Bitmap(sourceBitmap.Width, sourceBitmap.Height))
{
using (Graphics newGraph = Graphics.FromImage(newBitmap))
{
newGraph.FillRectangle(Brushes.White, 0, 0, newBitmap.Width, newBitmap.Height);
newGraph.DrawImage(sourceBitmap, new Point(0, 0));
newGraph.Save();
}

newBitmap.Save(fileName, imageFormat);
}
}
}

FileSavedDialog.Show(FindForm(), thumbnailPath, "All thumbnails saved successfully.");
}

private void ExportAnimatedGif(bool looping)
{
if (MainPictureBox.Frames == null)
Expand Down
5 changes: 4 additions & 1 deletion UoFiddler/Forms/AboutBoxForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="richTextBox1.Text" xml:space="preserve">
<value>Version 4.22.1
<value>Version 4.22.2
- Add export option to thumbnail list in animation tab.

Version 4.22.1
- Fix animation edit form gallery tiles dimensions.

Version 4.22.0
Expand Down
6 changes: 3 additions & 3 deletions UoFiddler/UoFiddler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<AssemblyTitle>UoFiddler</AssemblyTitle>
<Product>UoFiddler</Product>
<Copyright>Copyright © 2026</Copyright>
<AssemblyVersion>4.22.1</AssemblyVersion>
<FileVersion>4.22.1</FileVersion>
<Version>4.22.1</Version>
<AssemblyVersion>4.22.2</AssemblyVersion>
<FileVersion>4.22.2</FileVersion>
<Version>4.22.2</Version>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<PropertyGroup>
Expand Down