private void SetupConvert() { pcoDescr = new PCO_Description(); pcoDescr.wSize = (ushort)Marshal.SizeOf(pcoDescr); int err = 0; err = PCO_SDK_LibWrapper.PCO_GetCameraDescription(f_CameraHandle, ref pcoDescr); PCO_ConvertStructures.PCO_SensorInfo strsensorinf = new PCO_ConvertStructures.PCO_SensorInfo(); PCO_ConvertStructures.PCO_Display strDisplay = new PCO_ConvertStructures.PCO_Display(); strsensorinf.wSize = (ushort)Marshal.SizeOf(strsensorinf); strDisplay.wSize = (ushort)Marshal.SizeOf(strDisplay); strsensorinf.wDummy = 0; strsensorinf.iConversionFactor = 0; strsensorinf.iDataBits = pcoDescr.wDynResDESC; strsensorinf.iSensorInfoBits = 1; strsensorinf.iDarkOffset = 100; strsensorinf.dwzzDummy0 = 0; strsensorinf.strColorCoeff.da11 = 1.0; strsensorinf.strColorCoeff.da12 = 0.0; strsensorinf.strColorCoeff.da13 = 0.0; strsensorinf.strColorCoeff.da21 = 0.0; strsensorinf.strColorCoeff.da22 = 1.0; strsensorinf.strColorCoeff.da23 = 0.0; strsensorinf.strColorCoeff.da31 = 0.0; strsensorinf.strColorCoeff.da32 = 0.0; strsensorinf.strColorCoeff.da33 = 1.0; strsensorinf.iCamNum = 0; strsensorinf.hCamera = f_CameraHandle; int errorCode; /* We created a pointer to a convert object here */ errorCode = PCO_Convert_LibWrapper.PCO_ConvertCreate(ref f_ConvertHandle, ref strsensorinf, PCO_Convert_LibWrapper.PCO_COLOR_CONVERT); PCO_ConvertStructures.PCO_Convert pcoConv = new PCO_ConvertStructures.PCO_Convert();; pcoConv.wSize = (ushort)Marshal.SizeOf(pcoConv); errorCode = PCOConvertDll.PCO_Convert_LibWrapper.PCO_ConvertGet(f_ConvertHandle, ref pcoConv); pcoConv.wSize = (ushort)Marshal.SizeOf(pcoConv); IntPtr debugIntPtr = f_ConvertHandle; PCO_ConvertStructures.PCO_Convert pcoConvertlocal = (PCO_ConvertStructures.PCO_Convert)Marshal.PtrToStructure(debugIntPtr, typeof(PCO_ConvertStructures.PCO_Convert)); }
public static extern int PCO_ConvertGet(IntPtr pHandle, ref PCO_ConvertStructures.PCO_Convert pConvert);