相机格式更改

This commit is contained in:
Admin
2025-04-28 09:44:35 +08:00
parent 6a9e7e4343
commit bc0ed5d574
6 changed files with 167 additions and 87 deletions

View File

@ -27,7 +27,7 @@ namespace DH.Devices.Camera
public bool Connected=false;
public int m_n_dev_count = 0;
private DVPCamera.dvpStreamCallback ImageCallback;
public dvpStreamFormat dvpStreamFormat = dvpStreamFormat.S_RGB24;
// public dvpStreamFormat dvpStreamFormat = dvpStreamFormat.S_RGB24;
public int m_CamCount = 0;
public Double m_dfDisplayCount = 0;
@ -63,6 +63,8 @@ namespace DH.Devices.Camera
{
try
{
if (CameraName == "Cam1")
Console.WriteLine("");
pCallBackFunc = new DVPCamera.dvpEventCallback(cbExceptiondelegate);
nRet = DVPCamera.dvpOpenByUserId(CameraName,
dvpOpenMode.OPEN_NORMAL,
@ -74,7 +76,7 @@ namespace DH.Devices.Camera
throw new Exception($"Create device failed:{nRet:x8}");
}
nRet = DVPCamera.dvpSetTargetFormat(m_handle, (dvpStreamFormat)dvpStreamFormat);
nRet = DVPCamera.dvpSetTargetFormat(m_handle, (dvpStreamFormat)DvpImageFormat);
if (dvpStatus.DVP_STATUS_OK != nRet)
{
throw new Exception($"Set image format failed:{nRet:x8}");