improved picture cleaning

This commit is contained in:
tomse
2025-08-23 16:11:49 +02:00
parent ef6c017950
commit edf0f51cfe
2 changed files with 21 additions and 5 deletions

View File

@@ -171,31 +171,31 @@
// loadToolStripMenuItem
//
this.loadToolStripMenuItem.Name = "loadToolStripMenuItem";
this.loadToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.loadToolStripMenuItem.Size = new System.Drawing.Size(109, 22);
this.loadToolStripMenuItem.Text = "&Load...";
this.loadToolStripMenuItem.Click += new System.EventHandler(this.loadToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(106, 6);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.saveToolStripMenuItem.Size = new System.Drawing.Size(109, 22);
this.saveToolStripMenuItem.Text = "&Save";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(106, 6);
//
// quitToolStripMenuItem
//
this.quitToolStripMenuItem.Name = "quitToolStripMenuItem";
this.quitToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.quitToolStripMenuItem.Size = new System.Drawing.Size(109, 22);
this.quitToolStripMenuItem.Text = "&Quit";
this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click);
//

View File

@@ -267,12 +267,28 @@ namespace PDFWorkflowManager
{
pictureBox1.Image.Dispose();
pictureBox1.Image = null;
pictureBox1.Invalidate();
}
else
{
pictureBox1.Image = null;
pictureBox1.Invalidate();
}
if (pictureBox2.Image != null)
{
pictureBox2.Image.Dispose();
pictureBox2.Image = null;
pictureBox2.Invalidate();
}
else
{
pictureBox2.Image = null;
pictureBox2.Invalidate();
}
GC.Collect();
GC.WaitForPendingFinalizers();
}
catch
{ }