diff --git a/FModel/App.config b/FModel/App.config index 8291eb4c..f44a1203 100644 --- a/FModel/App.config +++ b/FModel/App.config @@ -1,4 +1,4 @@ - + @@ -145,6 +145,9 @@ True + + False + @@ -155,4 +158,4 @@ - \ No newline at end of file + diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index cc16058c..eb16bcb4 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -107,6 +107,7 @@ + diff --git a/FModel/Forms/Settings.Designer.cs b/FModel/Forms/Settings.Designer.cs index c44d4610..7b7e87b0 100644 --- a/FModel/Forms/Settings.Designer.cs +++ b/FModel/Forms/Settings.Designer.cs @@ -66,6 +66,7 @@ namespace FModel.Forms this.checkBox2 = new System.Windows.Forms.CheckBox(); this.textBox6 = new System.Windows.Forms.TextBox(); this.label12 = new System.Windows.Forms.Label(); + this.checkBoxSaveAsMergeImages = new System.Windows.Forms.CheckBox(); this.groupBox3.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox4.SuspendLayout(); @@ -149,7 +150,7 @@ namespace FModel.Forms // this.OKButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.OKButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.OKButton.Location = new System.Drawing.Point(475, 527); + this.OKButton.Location = new System.Drawing.Point(475, 546); this.OKButton.Name = "OKButton"; this.OKButton.Size = new System.Drawing.Size(97, 21); this.OKButton.TabIndex = 15; @@ -317,20 +318,21 @@ namespace FModel.Forms // // groupBox1 // + this.groupBox1.Controls.Add(this.checkBoxSaveAsMergeImages); this.groupBox1.Controls.Add(this.imgsPerRow); this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.textBox3); this.groupBox1.Controls.Add(this.label4); this.groupBox1.Location = new System.Drawing.Point(12, 473); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(560, 46); + this.groupBox1.Size = new System.Drawing.Size(560, 67); this.groupBox1.TabIndex = 17; this.groupBox1.TabStop = false; this.groupBox1.Text = "Merger"; // // imgsPerRow // - this.imgsPerRow.Location = new System.Drawing.Point(506, 19); + this.imgsPerRow.Location = new System.Drawing.Point(509, 41); this.imgsPerRow.Maximum = new decimal(new int[] { 20, 0, @@ -346,7 +348,7 @@ namespace FModel.Forms // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(412, 22); + this.label5.Location = new System.Drawing.Point(415, 44); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(88, 13); this.label5.TabIndex = 10; @@ -478,11 +480,21 @@ namespace FModel.Forms this.label12.TabIndex = 9; this.label12.Text = "Watermark:"; // + // checkBoxSaveAsMergeImages + // + this.checkBoxSaveAsMergeImages.AutoSize = true; + this.checkBoxSaveAsMergeImages.Location = new System.Drawing.Point(418, 18); + this.checkBoxSaveAsMergeImages.Name = "checkBoxSaveAsMergeImages"; + this.checkBoxSaveAsMergeImages.Size = new System.Drawing.Size(120, 17); + this.checkBoxSaveAsMergeImages.TabIndex = 13; + this.checkBoxSaveAsMergeImages.Text = "Enable \"Save as...\""; + this.checkBoxSaveAsMergeImages.UseVisualStyleBackColor = true; + // // Settings // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(584, 560); + this.ClientSize = new System.Drawing.Size(584, 579); this.Controls.Add(this.groupBox6); this.Controls.Add(this.groupBox5); this.Controls.Add(this.groupBox1); @@ -556,5 +568,6 @@ namespace FModel.Forms private System.Windows.Forms.TextBox textBox6; private System.Windows.Forms.Label label12; private System.Windows.Forms.CheckBox checkBox_tryToOpen; + private System.Windows.Forms.CheckBox checkBoxSaveAsMergeImages; } } diff --git a/FModel/Forms/Settings.cs b/FModel/Forms/Settings.cs index 4cbdb635..134fc480 100644 --- a/FModel/Forms/Settings.cs +++ b/FModel/Forms/Settings.cs @@ -34,6 +34,7 @@ namespace FModel.Forms //MERGER textBox3.Text = Properties.Settings.Default.mergerFileName; + checkBoxSaveAsMergeImages.Checked = Properties.Settings.Default.mergerImagesSaveAs; imgsPerRow.Value = Properties.Settings.Default.mergerImagesRow; //WATERMARK @@ -116,6 +117,7 @@ namespace FModel.Forms //MERGER Properties.Settings.Default.mergerFileName = textBox3.Text; + Properties.Settings.Default.mergerImagesSaveAs = checkBoxSaveAsMergeImages.Checked; Properties.Settings.Default.mergerImagesRow = Decimal.ToInt32(imgsPerRow.Value); //WATERMARK diff --git a/FModel/Methods/ImagesMerger/ImagesMerger.cs b/FModel/Methods/ImagesMerger/ImagesMerger.cs index bd9ec347..7e8b6806 100644 --- a/FModel/Methods/ImagesMerger/ImagesMerger.cs +++ b/FModel/Methods/ImagesMerger/ImagesMerger.cs @@ -1,8 +1,9 @@ -using FModel.Properties; +using FModel.Properties; using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; +using System.IO; using System.Globalization; using System.Windows.Forms; @@ -47,6 +48,20 @@ namespace FModel /// private static void MergeSelected(List mySelectedImages) { + string mergeFileName = Settings.Default.mergerFileName; + if (Properties.Settings.Default.mergerImagesSaveAs) + { + SaveFileDialog saveFileMergerImages = new SaveFileDialog(); + saveFileMergerImages.InitialDirectory = App.DefaultOutputPath; + saveFileMergerImages.DefaultExt = "png"; + saveFileMergerImages.Filter = "Image PNG (.png)|*.png"; + saveFileMergerImages.FileName = mergeFileName; + + if (saveFileMergerImages.ShowDialog() != DialogResult.OK) + return; + mergeFileName = Path.GetFileName(saveFileMergerImages.FileName); + } + if (Settings.Default.mergerImagesRow == 0) { Settings.Default.mergerImagesRow = 7; @@ -85,7 +100,11 @@ namespace FModel } } } - bmp.Save(App.DefaultOutputPath + "\\" + Settings.Default.mergerFileName + ".png", ImageFormat.Png); + + if (!mergeFileName.Contains(".png")) + mergeFileName += ".png"; + + bmp.Save(App.DefaultOutputPath + "\\" + mergeFileName, ImageFormat.Png); OpenMerged(bmp); } diff --git a/FModel/Properties/Settings.Designer.cs b/FModel/Properties/Settings.Designer.cs index ffd145ce..6c09992a 100644 --- a/FModel/Properties/Settings.Designer.cs +++ b/FModel/Properties/Settings.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Este código fue generado por una herramienta. +// Versión de runtime:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si +// se vuelve a generar el código. // //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ namespace FModel.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -562,5 +562,17 @@ namespace FModel.Properties { this["tryToOpenAssets"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool mergerImagesSaveAs { + get { + return ((bool)(this["mergerImagesSaveAs"])); + } + set { + this["mergerImagesSaveAs"] = value; + } + } } } diff --git a/FModel/Properties/Settings.settings b/FModel/Properties/Settings.settings index dd28b7c4..96a5adee 100644 --- a/FModel/Properties/Settings.settings +++ b/FModel/Properties/Settings.settings @@ -137,5 +137,8 @@ True + + False + \ No newline at end of file