private void OnGetDescription(object sender, System.EventArgs e) { pcoCameraType = new PCO_CameraType(); pcoDescr = new PCO_Description(); pcoStorage = new PCO_Storage(); pcoImage = new PCO_Image(); pcoDescr.wSize = (ushort)Marshal.SizeOf(pcoDescr); pcoStorage.wSize = (ushort)Marshal.SizeOf(pcoStorage); pcoImage.wSize = (ushort)Marshal.SizeOf(pcoImage); var err = PCO_SDK_LibWrapper.PCO_GetCameraDescription(f_CameraHandle, ref pcoDescr); err = PCO_SDK_LibWrapper.PCO_GetStorageStruct(f_CameraHandle, ref pcoStorage); pcoImage.strSegment = new PCO_Segment[4]; pcoImage.strSegment[0].wSize = (ushort)Marshal.SizeOf(typeof(PCO_Segment)); pcoImage.strSegment[1].wSize = (ushort)Marshal.SizeOf(typeof(PCO_Segment)); pcoImage.strSegment[2].wSize = (ushort)Marshal.SizeOf(typeof(PCO_Segment)); pcoImage.strSegment[3].wSize = (ushort)Marshal.SizeOf(typeof(PCO_Segment)); err = PCO_SDK_LibWrapper.PCO_GetImageStruct(f_CameraHandle, ref pcoImage); var usfwsize = (ushort)Marshal.SizeOf(typeof(PCO_SC2_Firmware_DESC)); usfwsize = (ushort)Marshal.SizeOf(typeof(PCO_FW_Vers)); pcoCameraType.strHardwareVersion.Board = new PCO_SC2_Hardware_DESC[10]; pcoCameraType.strFirmwareVersion.Device = new PCO_SC2_Firmware_DESC[10]; for (var i = 0; i < 10; i++) { pcoCameraType.strHardwareVersion.Board[i].szName = "123456789012345"; pcoCameraType.strFirmwareVersion.Device[i].szName = "123456789012345"; } pcoCameraType.wSize = (ushort)Marshal.SizeOf(pcoCameraType); err = PCO_SDK_LibWrapper.PCO_GetCameraType(f_CameraHandle, ref pcoCameraType); var szCameraName = new byte[30]; err = PCO_SDK_LibWrapper.PCO_GetCameraName(f_CameraHandle, szCameraName, 30); SetupConvert(); cbStartCamera.IsEnabled = true; cbStopCamera.IsEnabled = true; }
public static extern int PCO_GetCameraType(IntPtr pHandle, ref PCO_CameraType strCameraType);