
Machine Vision Camera SDK (DotNet) Developer Guide
Console.WriteLine("Enum device failed:{0:x8}", nRet);
return;
}
Console.WriteLine("The number of devices found: " + Convert.ToString(stDevList.nDeviceNum));
if (0 == stDevList.nDeviceNum)
{
return;
}
MyCamera.MV_CC_DEVICE_INFO stDevInfo;
//Change the device information structure pointer to device information structure
stDevInfo = (MyCamera.MV_CC_DEVICE_INFO)Marshal.PtrToStructure(stDevList.pDeviceInfo[0],
typeof(MyCamera.MV_CC_DEVICE_INFO));
MyCamera device = new MyCamera();
//Create device
nRet = device.MV_CC_CreateDevice_NET(ref stDevInfo);
if (MyCamera.MV_OK != nRet)
{
Console.WriteLine("Create device failed:{0:x8}", nRet);
return;
}
//Open device
nRet = device.MV_CC_OpenDevice_NET(MyCamera.MV_ACCESS_Exclusive,0);
if (MyCamera.MV_OK != nRet)
{
Console.WriteLine("Open device failed:{0:x8}", nRet);
return;
}
bool bValue = true;
nRet = device.MV_CC_GetBoolValue_NET("ReverseX", ref bValue);
if (MyCamera.MV_OK != nRet)
{
Console.WriteLine("Get Bool Value failed:{0:x8}", nRet);
return;
}
//Other process...
//Close device
nRet = device.MV_CC_CloseDevice_NET();
if (MyCamera.MV_OK != nRet)
{
Console.WriteLine("Close device failed{0:x8}", nRet);
return;
}
46






















































































































































































































































































































































































































































































































































































































