Skip to content

Commit 53a6cc7

Browse files
author
Kabuto_W
committed
Fix the wrong image display on some occasions.
1 parent 098dc5e commit 53a6cc7

File tree

4 files changed

+13
-2204
lines changed

4 files changed

+13
-2204
lines changed

SimilarImages/SimilarImages/Form1.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Drawing.Drawing2D;
88
using System.Globalization;
99
using System.IO;
10-
using System.Linq;
1110
using System.Windows.Forms;
1211

1312
namespace SimilarImages
@@ -31,7 +30,6 @@ public Form1()
3130
private void Form1_SizeChanged(object sender, EventArgs e)
3231
{
3332
pnl_Image1.Width = pnl_Main.Width / 2;
34-
lvw_Result.Columns[0].Width = lvw_Result.Width;
3533
}
3634

3735
#region Config
@@ -185,6 +183,18 @@ private void btn_Process_Click(object sender, EventArgs e)
185183
}
186184
if (!AssertConfig(validFolderPath, tip)) { return; }
187185

186+
// Dispose previous items
187+
pictureBox1.Image?.Dispose();
188+
pictureBox1.Image = null;
189+
lb_Image1.Text = isSimplifiedChinese ? "图片 1" : "Image 1";
190+
lb_Image1.Tag = null;
191+
lb_Resolution1.Text = "";
192+
pictureBox2.Image?.Dispose();
193+
pictureBox2.Image = null;
194+
lb_Image2.Text = isSimplifiedChinese ? "图片 2" : "Image 2";
195+
lb_Image2.Tag = null;
196+
lb_Resolution2.Text = "";
197+
188198
// Process
189199
progressBar1.Visible = true;
190200
btn_Process.Enabled = false;

SimilarImages/SimilarImages/Form1.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@
685685
<value>11</value>
686686
</data>
687687
<data name="columnHeader1.Width" type="System.Int32, mscorlib">
688-
<value>159</value>
688+
<value>154</value>
689689
</data>
690690
<data name="lvw_Result.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
691691
<value>Fill</value>

0 commit comments

Comments
 (0)