diff --git a/UoFiddler.Controls/UserControls/AnimationListControl.Designer.cs b/UoFiddler.Controls/UserControls/AnimationListControl.Designer.cs index 7bb9bcd..f921979 100644 --- a/UoFiddler.Controls/UserControls/AnimationListControl.Designer.cs +++ b/UoFiddler.Controls/UserControls/AnimationListControl.Designer.cs @@ -79,6 +79,12 @@ private void InitializeComponent() FacingBar = new System.Windows.Forms.TrackBar(); tabPage2 = new System.Windows.Forms.TabPage(); listView = new UoFiddler.Controls.UserControls.TileView.TileViewControl(); + contextMenuStrip4 = new System.Windows.Forms.ContextMenuStrip(components); + exportAllThumbnailsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + asBmpToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); + asTiffToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); + asJpgToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); + asPngToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); statusStrip1 = new System.Windows.Forms.StatusStrip(); SettingsButton = new System.Windows.Forms.ToolStripDropDownButton(); sortAlphaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -109,6 +115,7 @@ private void InitializeComponent() groupBoxSettings.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)FacingBar).BeginInit(); tabPage2.SuspendLayout(); + contextMenuStrip4.SuspendLayout(); statusStrip1.SuspendLayout(); SuspendLayout(); // @@ -481,9 +488,10 @@ private void InitializeComponent() tabPage2.UseVisualStyleBackColor = true; // // listView - // + // listView.AutoScroll = true; listView.AutoScrollMinSize = new System.Drawing.Size(0, 116); + listView.ContextMenuStrip = contextMenuStrip4; listView.Dock = System.Windows.Forms.DockStyle.Fill; listView.FocusIndex = -1; listView.Font = new System.Drawing.Font("Segoe UI", 9F); @@ -506,6 +514,47 @@ private void InitializeComponent() listView.DrawItem += ListViewDrawItem; listView.MouseDoubleClick += ListView_DoubleClick; // + // contextMenuStrip4 + // + contextMenuStrip4.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { exportAllThumbnailsToolStripMenuItem }); + contextMenuStrip4.Name = "contextMenuStrip4"; + contextMenuStrip4.Size = new System.Drawing.Size(180, 26); + // + // exportAllThumbnailsToolStripMenuItem + // + exportAllThumbnailsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { asBmpToolStripMenuItem3, asTiffToolStripMenuItem3, asJpgToolStripMenuItem3, asPngToolStripMenuItem3 }); + exportAllThumbnailsToolStripMenuItem.Name = "exportAllThumbnailsToolStripMenuItem"; + exportAllThumbnailsToolStripMenuItem.Size = new System.Drawing.Size(179, 22); + exportAllThumbnailsToolStripMenuItem.Text = "Export All Thumbnails.."; + // + // asBmpToolStripMenuItem3 + // + asBmpToolStripMenuItem3.Name = "asBmpToolStripMenuItem3"; + asBmpToolStripMenuItem3.Size = new System.Drawing.Size(115, 22); + asBmpToolStripMenuItem3.Text = "As Bmp"; + asBmpToolStripMenuItem3.Click += OnClickExportAllThumbnailsBmp; + // + // asTiffToolStripMenuItem3 + // + asTiffToolStripMenuItem3.Name = "asTiffToolStripMenuItem3"; + asTiffToolStripMenuItem3.Size = new System.Drawing.Size(115, 22); + asTiffToolStripMenuItem3.Text = "As Tiff"; + asTiffToolStripMenuItem3.Click += OnClickExportAllThumbnailsTiff; + // + // asJpgToolStripMenuItem3 + // + asJpgToolStripMenuItem3.Name = "asJpgToolStripMenuItem3"; + asJpgToolStripMenuItem3.Size = new System.Drawing.Size(115, 22); + asJpgToolStripMenuItem3.Text = "As Jpg"; + asJpgToolStripMenuItem3.Click += OnClickExportAllThumbnailsJpg; + // + // asPngToolStripMenuItem3 + // + asPngToolStripMenuItem3.Name = "asPngToolStripMenuItem3"; + asPngToolStripMenuItem3.Size = new System.Drawing.Size(115, 22); + asPngToolStripMenuItem3.Text = "As Png"; + asPngToolStripMenuItem3.Click += OnClickExportAllThumbnailsPng; + // // statusStrip1 // statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { SettingsButton, GraphicLabel, BaseGraphicLabel, HueLabel }); @@ -630,6 +679,7 @@ private void InitializeComponent() groupBoxSettings.PerformLayout(); ((System.ComponentModel.ISupportInitialize)FacingBar).EndInit(); tabPage2.ResumeLayout(false); + contextMenuStrip4.ResumeLayout(false); statusStrip1.ResumeLayout(false); statusStrip1.PerformLayout(); ResumeLayout(false); @@ -640,19 +690,25 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem asBMpToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem asBmpToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem asBmpToolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem asBmpToolStripMenuItem3; private System.Windows.Forms.ToolStripMenuItem asJpgToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem asJpgToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem asJpgToolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem asJpgToolStripMenuItem3; private System.Windows.Forms.ToolStripMenuItem asPngToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem asPngToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem asPngToolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem asPngToolStripMenuItem3; private System.Windows.Forms.ToolStripMenuItem asTiffToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem asTiffToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem asTiffToolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem asTiffToolStripMenuItem3; private System.Windows.Forms.ToolStripStatusLabel BaseGraphicLabel; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ContextMenuStrip contextMenuStrip2; private System.Windows.Forms.ContextMenuStrip contextMenuStrip3; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip4; + private System.Windows.Forms.ToolStripMenuItem exportAllThumbnailsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exportFrameToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem extractAnimationToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem extractImageToolStripMenuItem; diff --git a/UoFiddler.Controls/UserControls/AnimationListControl.cs b/UoFiddler.Controls/UserControls/AnimationListControl.cs index 1c0af3e..3cc2df5 100644 --- a/UoFiddler.Controls/UserControls/AnimationListControl.cs +++ b/UoFiddler.Controls/UserControls/AnimationListControl.cs @@ -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) diff --git a/UoFiddler/Forms/AboutBoxForm.resx b/UoFiddler/Forms/AboutBoxForm.resx index 44bf742..6dcac7c 100644 --- a/UoFiddler/Forms/AboutBoxForm.resx +++ b/UoFiddler/Forms/AboutBoxForm.resx @@ -118,7 +118,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Version 4.22.1 + 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 diff --git a/UoFiddler/UoFiddler.csproj b/UoFiddler/UoFiddler.csproj index 04e39df..a9d2b68 100644 --- a/UoFiddler/UoFiddler.csproj +++ b/UoFiddler/UoFiddler.csproj @@ -9,9 +9,9 @@ UoFiddler UoFiddler Copyright © 2026 - 4.22.1 - 4.22.1 - 4.22.1 + 4.22.2 + 4.22.2 + 4.22.2 true