From eb6ac4e05eaaf3e1624c42ec37940683e0c27763 Mon Sep 17 00:00:00 2001 From: Jaex Date: Sun, 9 Oct 2022 13:52:38 +0300 Subject: [PATCH] Added image count --- .../Forms/ImageCombinerForm.Designer.cs | 8 + ShareX.MediaLib/Forms/ImageCombinerForm.cs | 30 ++-- ShareX.MediaLib/Forms/ImageCombinerForm.resx | 149 ++++++++++++------ 3 files changed, 130 insertions(+), 57 deletions(-) diff --git a/ShareX.MediaLib/Forms/ImageCombinerForm.Designer.cs b/ShareX.MediaLib/Forms/ImageCombinerForm.Designer.cs index 4319a4ebd..c5a906856 100644 --- a/ShareX.MediaLib/Forms/ImageCombinerForm.Designer.cs +++ b/ShareX.MediaLib/Forms/ImageCombinerForm.Designer.cs @@ -49,6 +49,7 @@ private void InitializeComponent() this.lblWrapAfter = new System.Windows.Forms.Label(); this.nudWrapAfter = new System.Windows.Forms.NumericUpDown(); this.lblWrapAfterImages = new System.Windows.Forms.Label(); + this.lblImageCount = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.nudSpace)).BeginInit(); this.flpOrientation.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudWrapAfter)).BeginInit(); @@ -200,6 +201,11 @@ private void InitializeComponent() resources.ApplyResources(this.lblWrapAfterImages, "lblWrapAfterImages"); this.lblWrapAfterImages.Name = "lblWrapAfterImages"; // + // lblImageCount + // + resources.ApplyResources(this.lblImageCount, "lblImageCount"); + this.lblImageCount.Name = "lblImageCount"; + // // ImageCombinerForm // this.AcceptButton = this.btnCombine; @@ -207,6 +213,7 @@ private void InitializeComponent() resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.SystemColors.Window; + this.Controls.Add(this.lblImageCount); this.Controls.Add(this.lblWrapAfterImages); this.Controls.Add(this.nudWrapAfter); this.Controls.Add(this.lblWrapAfter); @@ -258,5 +265,6 @@ private void InitializeComponent() private System.Windows.Forms.Label lblWrapAfter; private System.Windows.Forms.NumericUpDown nudWrapAfter; private System.Windows.Forms.Label lblWrapAfterImages; + private System.Windows.Forms.Label lblImageCount; } } \ No newline at end of file diff --git a/ShareX.MediaLib/Forms/ImageCombinerForm.cs b/ShareX.MediaLib/Forms/ImageCombinerForm.cs index cf637e9ab..bc8ecfd49 100644 --- a/ShareX.MediaLib/Forms/ImageCombinerForm.cs +++ b/ShareX.MediaLib/Forms/ImageCombinerForm.cs @@ -61,6 +61,19 @@ public ImageCombinerForm(ImageCombinerOptions options) cbAutoFillBackground.Checked = Options.AutoFillBackground; } + public ImageCombinerForm(ImageCombinerOptions options, IEnumerable imageFiles) : this(options) + { + if (imageFiles != null) + { + foreach (string image in imageFiles) + { + lvImages.Items.Add(image); + } + + lblImageCount.Text = lvImages.Items.Count.ToString(); + } + } + private void UpdateOrientation() { if (rbOrientationHorizontal.Checked) @@ -93,17 +106,6 @@ private void UpdateAlignmentComboBox() cbAlignment.SelectedIndex = (int)Options.Alignment; } - public ImageCombinerForm(ImageCombinerOptions options, IEnumerable imageFiles) : this(options) - { - if (imageFiles != null) - { - foreach (string image in imageFiles) - { - lvImages.Items.Add(image); - } - } - } - private void btnAdd_Click(object sender, EventArgs e) { string[] images = ImageHelpers.OpenImageFileDialog(true); @@ -114,6 +116,8 @@ private void btnAdd_Click(object sender, EventArgs e) { lvImages.Items.Add(image); } + + lblImageCount.Text = lvImages.Items.Count.ToString(); } } @@ -125,6 +129,8 @@ private void btnRemove_Click(object sender, EventArgs e) { lvImages.Items.Remove(lvi); } + + lblImageCount.Text = lvImages.Items.Count.ToString(); } } @@ -228,6 +234,8 @@ private void ImageCombinerForm_DragDrop(object sender, DragEventArgs e) { lvImages.Items.Add(file); } + + lblImageCount.Text = lvImages.Items.Count.ToString(); } } } diff --git a/ShareX.MediaLib/Forms/ImageCombinerForm.resx b/ShareX.MediaLib/Forms/ImageCombinerForm.resx index 8e7f74d04..905937055 100644 --- a/ShareX.MediaLib/Forms/ImageCombinerForm.resx +++ b/ShareX.MediaLib/Forms/ImageCombinerForm.resx @@ -122,7 +122,7 @@ 8, 8 - 120, 23 + 120, 25 @@ -141,13 +141,13 @@ $this - 16 + 17 136, 8 - 120, 23 + 120, 25 1 @@ -165,13 +165,13 @@ $this - 15 + 16 264, 8 - 120, 23 + 120, 25 2 @@ -189,13 +189,13 @@ $this - 14 + 15 392, 8 - 120, 23 + 120, 25 3 @@ -213,18 +213,12 @@ $this - 13 + 14 Top, Bottom, Left, Right - - Image file path - - - 487 - 8, 40 @@ -244,7 +238,13 @@ $this - 12 + 13 + + + Image file path + + + 487 Bottom, Left, Right @@ -271,7 +271,7 @@ $this - 11 + 12 Bottom, Left @@ -301,7 +301,7 @@ $this - 10 + 11 Bottom, Left @@ -328,7 +328,7 @@ $this - 9 + 10 Bottom, Left @@ -358,7 +358,7 @@ $this - 8 + 9 Bottom, Left @@ -388,7 +388,7 @@ $this - 7 + 8 Bottom, Left @@ -418,7 +418,7 @@ $this - 6 + 7 Bottom, Left @@ -442,7 +442,7 @@ $this - 5 + 6 Bottom, Left @@ -450,6 +450,51 @@ True + + rbOrientationHorizontal + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flpOrientation + + + 0 + + + rbOrientationVertical + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flpOrientation + + + 1 + + + 200, 371 + + + 141, 23 + + + 6 + + + flpOrientation + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + True @@ -507,27 +552,6 @@ 1 - - 200, 371 - - - 141, 23 - - - 6 - - - flpOrientation - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - Bottom, Left @@ -556,7 +580,7 @@ $this - 3 + 4 Bottom, Left @@ -586,7 +610,7 @@ $this - 2 + 3 Bottom, Left @@ -613,7 +637,7 @@ $this - 1 + 2 Bottom, Left @@ -643,6 +667,36 @@ $this + 1 + + + Bottom, Right + + + 472, 368 + + + 40, 24 + + + 17 + + + 0 + + + TopRight + + + lblImageCount + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 @@ -654,6 +708,9 @@ 521, 536 + + 537, 400 + CenterScreen