修改程式0118

This commit is contained in:
JEFF 2025-01-18 21:40:45 +08:00
parent ed1681a2e4
commit 420325b4e5
2 changed files with 8 additions and 0 deletions

View File

@ -162,6 +162,7 @@
Controls.Add(Bt_connect); Controls.Add(Bt_connect);
Name = "Main"; Name = "Main";
Text = "Form1"; Text = "Form1";
FormClosed += Form1_FormClosed;
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
ResumeLayout(false); ResumeLayout(false);
PerformLayout(); PerformLayout();

View File

@ -308,5 +308,12 @@ namespace Camera_connect
} }
} }
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
Basler.DestroyCamera();
pictureBox1.Image?.Dispose();
}
} }
} }