修正
This commit is contained in:
parent
3a309775a0
commit
19febccd11
@ -7,23 +7,18 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
namespace Camera_connect
|
namespace Camera_connect
|
||||||
{
|
{
|
||||||
public class BaslerCamera
|
public class BaslerCamera(Main form)
|
||||||
{
|
{
|
||||||
private readonly Main form;
|
private readonly Main form = form;
|
||||||
private readonly object lockObject = new object();
|
private readonly object lockObject = new();
|
||||||
public int CameraNumber => CameraFinder.Enumerate().Count;
|
public int CameraNumber => CameraFinder.Enumerate().Count;
|
||||||
public event Action<Bitmap> CameraImageEvent;
|
public event Action<Bitmap> CameraImageEvent;
|
||||||
|
|
||||||
private readonly List<Camera> allCameras = new List<Camera>();
|
private readonly List<Camera> allCameras = [];
|
||||||
private readonly PixelDataConverter pxConvert = new PixelDataConverter();
|
private readonly PixelDataConverter pxConvert = new();
|
||||||
private bool isGrabbing;
|
private bool isGrabbing;
|
||||||
private bool isCameraOpen = false;
|
private bool isCameraOpen = false;
|
||||||
|
|
||||||
public BaslerCamera(Main form)
|
|
||||||
{
|
|
||||||
this.form = form;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CameraInit()
|
public void CameraInit()
|
||||||
{
|
{
|
||||||
var allCameraInfos = CameraFinder.Enumerate();
|
var allCameraInfos = CameraFinder.Enumerate();
|
||||||
|
@ -236,7 +236,7 @@ namespace Camera_connect
|
|||||||
// <20>穝 PictureBox 瓜钩
|
// <20>穝 PictureBox 瓜钩
|
||||||
pictureBox1.Invoke((MethodInvoker)delegate
|
pictureBox1.Invoke((MethodInvoker)delegate
|
||||||
{
|
{
|
||||||
Bitmap oldImage = pictureBox1.Image as Bitmap;
|
Bitmap? oldImage = pictureBox1.Image as Bitmap;
|
||||||
pictureBox1.Image = image;
|
pictureBox1.Image = image;
|
||||||
oldImage?.Dispose(); // 絋玂睦<E78E82>侣<EFBFBD> Bitmap 戈方
|
oldImage?.Dispose(); // 絋玂睦<E78E82>侣<EFBFBD> Bitmap 戈方
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user