API Descriptions (C#)
GetVersionString()
Gets VCameraSDK Version.
string versionString = UCV.CameraApi.Interop.Version.GetVersionString();
Console.WriteLine($"GetVersionString: {versionString}");
CameraUtils Class
CameraUtils is a static utility class provided by the SDK, dedicated to camera device discovery and network configuration.
Init()
Initializes the camera system environment.
CameraUtils.Init(true);
Important
Direct connection mode (default, recommended): Call
Init(true). This mode is sufficient for regular users. A single camera can only be connected by one process.RPC mode (advanced): Call
Init(false), which supports multi-process connection. It is not recommended for regular users and should only be used when multiple processes are required. In this mode, copy the files in theVcameraSDK-X.X.X/rpc/folder to the program directory. For specific usage, contact Percipio technical support.
Note: The function must be called before other operations.
DiscoverCameras()
Scans and discovers all available cameras.
CameraUtils.DiscoverCameras();
SetIpAddress()
Sets the camera’s IP to static. Needs to input the camera’s MAC address and the desired IP, netmask, and gateway.
string mac = "06:2E:68:E5:81:8C";
string ip = "192.168.6.37";
string mask = "255.255.255.0";
string gateway = "192.168.6.1";
CameraApiStatus status = CameraUtils.SetIpAddress(mac, ip, mask, gateway);
if (status == CameraApiStatus.Success)
{
Console.WriteLine($"Successfully set the IP of the camera {mac} to {ip}");
}
SetDeviceDhcp()
Sets the camera’s IP to Dynamic. Needs to input the camera’s MAC address.
CameraUtils.SetDeviceDhcp("06:22:7F:05:9B:16");
CameraCapture Class
CameraCapture is a factory class defined by Percipio SDK, specialized in instantiating and connecting camera devices with different configurations. It provides three static factory methods to create camera instances via serial number, IP address, or pre-configured information.
GetCameraBySerialNumber()
Obtains a camera object by its serial number.
CameraCapture.GetCameraBySerialNumber("207000159205");
GetCameraByIpAddress()
Obtains a camera object by its IP address.
CameraCapture.GetCameraByIpAddress("192.168.6.50");
GetCameraByDeviceInfo()
Obtains a camera object by the camera’s information.
// Camera initialization
CameraUtils.Init(true);
// Discover all available cameras
CameraCapture camera = null;
var deviceList = CameraUtils.DiscoverCameras();
foreach (var list in deviceList)
{
// Output camera info
Console.WriteLine($"Serial Number: {list.Sn}, Model Name: {list.ModelName}, IP: {list.NetworkInfo.Ip}");
if (list.Sn == "207000163420")
{
cc = CameraCapture.GetCameraByDeviceInfo(list);
Console.WriteLine($"Target Camera Found: {list.ModelName}");
break;
}
}
GetCameraInfo()
Obtains camera device information.
// Camera initialization
CameraUtils.Init(true);
// Discover camera
var deviceList = CameraUtils.DiscoverCameras();
if (deviceList.Count == 0)
{
Console.WriteLine("No camera found!");
return;
}
// Connect camera and get camera info
foreach (var camInfo in deviceList)
{
// Create camera instance
CameraCapture cc = CameraCapture.GetCameraByDeviceInfo(camInfo);
// Connect camera
CameraApiStatus connectStatus = cc.Connect();
if (connectStatus != CameraApiStatus.Success)
{
Console.WriteLine($"Connect camera {camInfo.Sn} failed: {connectStatus}");
continue;
}
// Get camera information via GetCameraInfo()
CameraInfo detailedInfo;
CameraApiStatus infoStatus = cc.GetCameraInfo(out detailedInfo);
if (infoStatus == CameraApiStatus.Success)
{
Console.WriteLine("\n====== Camera Detailed Information ======");
Console.WriteLine($" Model Name: {detailedInfo.ModelName}");
Console.WriteLine($" Serial Number: {detailedInfo.Sn}");
Console.WriteLine($" IP Address: {detailedInfo.NetworkInfo.Ip}");
Console.WriteLine($" Name: {detailedInfo.Name}");
Console.WriteLine($" Vendor Name: {detailedInfo.VendorName}");
Console.WriteLine($" Firmware Version: {detailedInfo.FirmwareVersion}");
Console.WriteLine($" State: {detailedInfo.State}");
// Network Info
Console.WriteLine($" MAC Address: {detailedInfo.NetworkInfo.Mac}");
Console.WriteLine($" Subnet Mask: {detailedInfo.NetworkInfo.Netmask}");
Console.WriteLine($" Gateway: {detailedInfo.NetworkInfo.Gateway}");
// Interface Info
Console.WriteLine($" Interface Type: {detailedInfo.InterfaceInfo.InterfaceType}");
Console.WriteLine($" Interface Name: {detailedInfo.InterfaceInfo.Name}");
}
else
{
Console.WriteLine($"Get Camera {camInfo.Sn} Detailed Information Failed: {infoStatus}");
}
// Disconnect camera
cc.Disconnect();
}
Connect()
Connects the camera.
cc.Connect();
Disconnect()
Disconnects the camera.
cc.Disconnect();
EnableReconnectWhenOffline()
Enables unlimited reconnection attempts after the camera goes offline.
Note
Reconnection must be configured before calling Connect().
status = cc.EnableReconnectWhenOffline();
EnableReconnectWhenOfflineWithMaxAttempts()
Enables reconnection after the camera goes offline and sets the maximum number of attempts.
status = cc.EnableReconnectWhenOfflineWithMaxAttempts(max_try_times);
EnableReconnectWhenOfflineWithTimeoutSeconds()
Enables reconnection after the camera goes offline and sets the timeout.
status = cc.EnableReconnectWhenOfflineWithTimeoutSeconds(max_try_time_seconds);
DisableReconnectWhenOffline()
Disables reconnection after the camera goes offline and stops any ongoing reconnection attempts.
status = cc.DisableReconnectWhenOffline();
Retrieve Camera State
Retrieves the camera state.
var status = cc.Connect();
if (status != CameraApiStatus.Success)
{
Console.WriteLine($"Failed to connect camera: {status}");
return;
}
StartCapture()
Starts image capture.
cc.StartCapture();
StopCapture()
Stops image capture.
cc.StopCapture();
GetFeature()
Retrieves a feature for setting.
Important
The list of features supported by the SDK for configuration is found in VcameraSDK-X.X.X/doc/feature_list/.
CameraFeature feature;
CameraApiStatus status = cc.GetFeature("Left/ExposureTime", out feature);
Console.WriteLine($"GetFeature Left/ExposureTime Status: {status}");
GetAllFeatures()
Retrieves all features.
cc.GetAllFeatures();
FireSoftwareTrigger()
Sends a software trigger signal to a camera operating in software trigger mode.
cc.FireSoftwareTrigger();
IsSupportGenicam()
Determines whether the camera complies with the GenICam standard. If it returns True, the camera complies with the GenICam standard.
CameraApiStatus ret = CameraApiStatus.Success;
cc = CameraCapture.GetCameraByDeviceInfo(camInfo);
ret = cc.Connect();
if(ret == CameraApiStatus.Success)
{
bool isSupport = cc.IsSupportGenicam(out status);
if (status == CameraApiStatus.Success)
{
if (isSupport)
{
Console.WriteLine("Support GenICam");
}
else
{
Console.WriteLine("Not Support GenICam");
}
}
else
{
Console.WriteLine($" IsSupportGenicam API call : {status}");
}
}
GetImageModes()
Retrieves the image formats and resolutions that is set for a specified sensor.
List<ImageMode> image_modes = cc.GetImageModes(SensorType.IrRight, out status);
if (status != CameraApiStatus.Success)
{
Console.WriteLine($"GetImageModes failed : {status}");
}
else
{
foreach (var mode in image_modes)
{
Console.WriteLine($"ImageModePixelFormat : {mode.RawPixelFormat} , ImageModeWidth : {mode.Width} , ImageModeHeight : {mode.Height}");
}
}
GetCurrentImageMode()
Retrieves the current image format and resolution of a specified sensor.
var currentMode = cc.GetCurrentImageMode(SensorType.IrLeft, out status);
Console.WriteLine($"ImageModePixelFormat : {currentMode.RawPixelFormat} , ImageModeWidth : {currentMode.Width} , ImageModeHeight : {currentMode.Height}");
SetImageMode()
Sets the image format and resolution for a specified sensor.
ImageMode image_mode = new ImageMode();
image_mode.RawPixelFormat = RawPixelFormat.JPEG;
image_mode.Width = 640;
image_mode.Height = 480;
status = cc.SetImageMode(SensorType.Color, image_mode);
Console.WriteLine($"Set image format and resolution: {status}");
HasSensor()
Checks if the camera has a specified sensor.
// Read sensors supported by the camera
var sensorTypes = Enum.GetValues(typeof(SensorType)).Cast<SensorType>();
foreach (var sensorType in sensorTypes)
{
if (cc.HasSensor(sensorType))
{
Console.WriteLine($"Supported sensor: {sensorType}");
}
}
The camera supports the following sensor types:
DEPTH = “Depth”
LEFT = “Left”
RIGHT = “Right”
COLOR = “Color”
IsSensorEnabled()
Checks if a specified sensor of the camera is enabled.
// Read the enabled status of sensors supported by the camera
var sensorTypes = Enum.GetValues(typeof(SensorType)).Cast<SensorType>();
foreach (var sensorType in sensorTypes)
{
if (cc.HasSensor(sensorType))
{
bool enabled;
status = cc.IsSensorEnabled(sensorType, out enabled);
if (status == CameraApiStatus.Success)
{
Console.WriteLine($"Sensor {sensorType}: {(enabled ? "Enabled" : "Disabled")}");
}
}
}
SetSensorEnabled()
Enables or disables image output for a specified sensor.
CameraApiStatus status = cc.SetSensorEnabled(SensorType.Depth, true);
if (status != CameraApiStatus.Success)
{
Console.WriteLine($"Failed to set sensor enabled: {status}");
return;
}
SetUndistortionEnabled()
Enables or disables distortion correction for images from a specified sensor.
cc.SetUndistortionEnabled(SensorType.Color, true);
IsMapDepthToTextureEnabled()
Used to query whether depth-to-color image mapping (depth and color alignment) is enabled.
bool en = false;
cc.IsMapDepthToTextureEnabled(out en);
Console.WriteLine($"IsMapDepthToTextureEnabled: {en}");
SetMapDepthToTextureEnabled()
Enables or disables depth-to-color image mapping (alignment between depth and color images).
Note
This interface is mutually exclusive with SetMapTextureToDepthEnabled(). Select the appropriate alignment mode as needed.
status = cc.SetMapDepthToTextureEnabled(true);
if (status != CameraApiStatus.Success)
{
Console.WriteLine($"Failed to enable MapDepthToTexture: {status}");
return;
}
IsMapTextureToDepthEnabled()
Used to query whether texture-to-depth image mapping (color-to-depth alignment) is enabled.
bool en = false;
cc.IsMapTextureToDepthEnabled(out en);
Console.WriteLine($"IsMapTextureToDepthEnabled: {en}");
SetMapTextureToDepthEnabled()
Enables or disables texture-to-depth image mapping (color-to-depth alignment).
Note
This interface is mutually exclusive with SetMapDepthToTextureEnabled(). Select the appropriate alignment mode as needed.
status = cc.SetMapTextureToDepthEnabled(true);
if (status != CameraApiStatus.Success)
{
Console.WriteLine($"Failed to enable MapTextureToDepth: {status}");
return;
}
For detailed usage instructions, see the sample program VcameraSDK-X.X.X/csharp/net48/example/ImageRegistration/Program.cs.
SaveFeaturesToFile()
Saves the camera configuration to a JSON file.
Note
The saving behavior varies by camera type:
Non-GenICam cameras: Only parameters modified after the camera connection are saved. Parameters saved before the connection are not recorded.
GenICam cameras: All parameters are saved as much as possible. For the specific saved parameter list, refer to
doc/feature_save_gige2_1.txtunder the installation path.
Example: Save the camera configuration to the 1.json file.
string filePath = "1.json";
status = cc.SaveFeaturesToFile(filePath);
For detailed usage instructions, see the sample program VcameraSDK-X.X.X/csharp/net48/example/SaveFeaturesToFile/Program.cs.
LoadFeaturesFromFile()
Loads a configuration from a JSON file and applies it to the camera.
Note
The following optional parameters are available since V25.1.7:
restore_sensor_enable_state: Whether to overwrite the sensor enable state parameters when loading, default value istrue.restore_acquisition_and_trigger: Whether to overwrite the acquisition and trigger mode parameters (continuous mode, software trigger mode) when loading, default value istrue.
If you do not want to modify the current sensor enable state, acquisition state, or trigger mode when loading a configuration, set the corresponding parameter to false.
Example: Load the camera configuration from the 1.json file.
string error_message = "";
// We strongly recommend to use path only including ASCII characters.
string file_path_load = "1.json";
status = cc.LoadFeaturesFromFile(file_path_load, ref error_message);
If you do not want to modify the current sensor enable state, acquisition state, or trigger mode when loading a camera configuration, set restore_sensor_enable_state and restore_acquisition_and_trigger to false.
string error_message = "";
// We strongly recommend to use path only including ASCII characters.
string file_path_load = "1.json";
status = cc.LoadFeaturesFromFile(file_path_load, ref error_message, false, false);
For detailed usage instructions, see the sample program VcameraSDK-X.X.X/csharp/net48/example/LoadFeaturesFromFile/Program.cs.
SaveFeaturesToStorage()
Saves the camera configuration to the camera’s internal storage.
Note
This interface applies only to non-GenICam cameras.
For GenICam cameras, use the UserSetManager class interface.
Save Configuration to Internal Storage:
status = cc.SaveFeaturesToStorage();
For detailed usage instructions, see the sample program VcameraSDK-X.X.X/csharp/net48/example/SaveFeaturesToStorage/Program.cs.
LoadFeaturesFromStorage()
Loads a configuration from the camera’s internal storage.
Note
This interface applies only to non-GenICam cameras.
For GenICam cameras, use the UserSetManager class interface.
Note
The following optional parameters are available since V25.1.7:
restore_sensor_enable_state: Whether to overwrite the sensor enable state related parameters when loading, default value istrue.restore_acquisition_and_trigger: Whether to overwrite the acquisition and trigger mode related parameters (continuous mode, software trigger mode), default value istrue.
If you do not want to modify the current sensor enable state, acquisition state, or trigger mode when loading a configuration, set the corresponding parameter to false.
Example: Load a configuration from the camera’s internal storage.
string error_message = "";
status = cc.LoadFeaturesFromStorage(ref error_message);
If you do not want to modify the current sensor enable state, acquisition state, or trigger mode when loading a camera configuration, set restore_sensor_enable_state and restore_acquisition_and_trigger to false.
string error_message = "";
status = cc.LoadFeaturesFromStorage(ref error_message, false, false);
For detailed usage instructions, see the sample program VcameraSDK-X.X.X/csharp/net48/example/LoadFeaturesFromStorage/Program.cs.
RegisterFrameSetCallback()
Registers an image callback function.
RegisterCameraEventCallback()
Registers a camera event callback function.
RegisterFeaturesChangedCallback()
Registers a feature change callback function.
GetFactoryCalibInfo()
Gets the factory calibration information for the specified sensor.
status = cc.GetFactoryCalibInfo(sensorType, out CalibInfo calibInfo);
GetRectificationRotation()
Gets the stereo rectification rotation matrix for the specified sensor.
Important
Prerequisite: Only call this interface when you need to implement stereo rectification yourself. If SetUndistortionEnabled() is already enabled, the SDK has already used the rotation parameters internally, and there is no need to call this interface.
Applicable scope: Applies only to the left and right IR sensors.
status = cc.GetRectificationRotation(sensorType, out CameraRotation rotation);
GetRectifiedIntrinsic()
Gets the rectified intrinsic parameters for the specified sensor.
Important
Prerequisite: Only call this interface when you need to implement stereo rectification yourself. If SetUndistortionEnabled() is already enabled, the images returned by the SDK already come with the rectified intrinsic parameters, and there is no need to call this interface.
Applicable scope: Applies only to the left and right IR sensors.
status = cc.GetRectifiedIntrinsic(sensorType, out CameraIntrinsic intrinsic);
GetRectifiedExtrinsic()
Gets the rectified extrinsic parameters for the specified sensor.
Important
Prerequisite: Only call this interface when you need to implement stereo rectification yourself. If SetUndistortionEnabled() is already enabled, the images returned by the SDK already come with the rectified extrinsic parameters, and there is no need to call this interface.
Applicable scope: Applies only to the right IR sensor.
status = cc.GetRectifiedExtrinsic(sensorType, out CameraExtrinsic extrinsic);
SetParallelEnabled()
Enables or disables multi-core CPU acceleration for image-processing functions.
Note
When disabled, the CPU usage of image-processing operations such as undistortion is reduced, but the processing time may increase. If real-time requirements cannot be met, it is recommended to use image processing libraries such as OpenCV for undistortion and other operations.
status = ImageProc.SetParallelEnabled(true);
UserSetManager Class
GetAllUserSets()
Retrieves all UserSets of the camera.
var userSetMgr = cc.GetUserSetManager();
var userSets = new List<UserSet>();
status = userSetMgr.GetAllUserSets(userSets);
Console.WriteLine("Available Usersets:");
for (int i = 0; i < userSets.Count; i++)
{
Console.WriteLine($" [{i}] {userSets[i].Name}");
}
SaveToUserSet()
Saves the current camera’s parameter settings to the specified Userset.
var userSetMgr = cc.GetUserSetManager();
status = userSetMgr.SaveToUserSet("Default");
if (status == CameraApiStatus.Success)
{
Console.WriteLine("Parameter settings saved to Userset named Default");
}
else
{
Console.WriteLine($"Save failed: {status}");
}
SaveToUserSetWithNewName()
Renames an existing Userset.
var userSetMgr = cc.GetUserSetManager();
status = userSetMgr.SaveToUserSetWithNewName("MyCustomConfig", "9876");
if (status == CameraApiStatus.Success)
{
Console.WriteLine("Parameter settings saved as 9876");
}
LoadUserSet()
Loads the desired Userset.
// Get the Userset manager
var userSetMgr = cc.GetUserSetManager();
CameraApiStatus status = userSetMgr.LoadUserSet("HighAccuracy");
if (status == CameraApiStatus.Success)
{
Console.WriteLine("High accuracy mode Userset loaded");
}
else
{
Console.WriteLine($"Failed to load Userset set: {status}");
}
CurrentUserSet()
Reads the name of the currently used Userset.
// Get the Userset manager
var userSetMgr = cc.GetUserSetManager();
// Get the current Userset
string currentUserSet;
status = userSetMgr.CurrentUserSet(out currentUserSet);
if (status == CameraApiStatus.Success)
{
if (string.IsNullOrWhiteSpace(currentUserSet))
{
Console.WriteLine("No Userset is currently set");
}
else
{
Console.WriteLine($"Current Userset: {currentUserSet}");
}
}
else
{
Console.WriteLine($"Failed to get current Userset: {status}");
}
GetPowerOnUserSet()
Reads the name of the default Userset when the camera powers on.
var userSetMgr = cc.GetUserSetManager();
// Get the current Userset at boot
string powerOnUserSet;
status = userSetMgr.GetPowerOnUserSet(out powerOnUserSet);
if (status == CameraApiStatus.Success)
{
if (string.IsNullOrEmpty(powerOnUserSet))
{
Console.WriteLine("No Userset at boot is currently set");
}
else
{
Console.WriteLine($"Current Userset at boot: {powerOnUserSet}");
}
}
else
{
Console.WriteLine($"Failed to get Userset at boot: {status}");
}
SetPowerOnUserSet()
Sets the Userset when the camera powers on.
string optimizedConfig = "HighAccuracy";
status = userSetMgr.SetPowerOnUserSet(optimizedConfig);
if (status == CameraApiStatus.Success)
{
Console.WriteLine($"Device configured to automatically load '{optimizedConfig}' mode on startup");
}
CameraApiStatusCode
Success,
Failure,
ArrayInfoInvalid,
ArrayInvalid,
CalibrationInfoInvalid,
CameraInvalid,
ComponentInvalid,
DeviceInvalid,
DeviceError,
DeviceIdle,
DeviceBusy,
DeviceLost,
DeviceInterfaceInvalid,
DeviceInterfaceTypeError,
DeviceInfoInvalid,
FeatureInvalid,
FeatureInfoInvalid,
FeatureTypeError,
FrameInvalid,
FrameMetadataInvalid,
FrameBufferInvalid,
FrameBufferConsumerInvalid,
FrameSetInvalid,
FrameSetStreamInvalid,
FrameSetConsumerInvalid,
TriggerModeError,
NotExist,
NotImplemented,
NotPermitted,
NotSupported,
OutOfMemory,
OutOfIndexRange,
OutOfValueRange,
ParameterInvalid,
StructureInfoInvalid,
StructureInvalid,
Timeout,
ValueInvalid,
ValueTypeError,
ValueInfoInvalid,
NullCameraHandle,
UserSetIsFull,
Camera Feature Class
Basic Information Methods
IsValid()
Determines whether the camera supports this feature.
CameraFeature feature;
CameraApiStatus ret = cc.GetFeature("DepthScaleUnit", out feature);
bool isValid = feature.IsValid();
if (isValid)
{
Console.WriteLine("\u001b[92m Feature is valid and available\u001b[0m");
}
FullName
Retrieves the full path name of the feature, typically including grouping information.
CameraFeature feature;
cc.GetFeature("DepthSgbmUniqueMaxCost", out feature);
string fullName = feature.FullName;
Console.WriteLine($"Full name: {fullName}");
Get Feature Type
Retrieves the feature type.
CameraFeature feature;
string featureName = "AcquisitionMode";
cc.GetFeature(featureName, out feature);
FeatureType type = feature.FeatureType;
Console.WriteLine($"{featureName} FeatureType is {type}");
VCameraSDK supports the following eight feature types:
Undefined
Bool
Int64
Float64
Enumeration
String
ByteArray
Dictionary
GetAccessMode()
Retrieves the camera feature permission.
CameraFeature feature;
CameraApiStatus ret = cc.GetFeature("Depth/ExposureTime", out feature);
CameraFeatureAccessMode access_mode;
ret = feature.GetAccessMode(out access_mode);
if (ret == CameraApiStatus.Success)
{
Console.WriteLine($"Depth/ExposureTime AccessMode : {access_mode}");
}
VCameraSDK supports the following four access modes:
NotAvailable
Readable
Writable
ReadWritable
Value Operation Methods
GetValue()
Retrieves the current value of a feature.
Integer feature
CameraFeature feat; cc.GetFeature("DepthSgbmTextureFilterValueOffset", out feat); CameraValue currentValue; feat.GetValue(out currentValue); Console.WriteLine($"Left/ExposureTime current value: {currentValue.SingleValue}");Float feature
CameraFeature feat; cc.GetFeature("Left/ExposureTime", out feat); CameraValue currentValue; feat.GetValue(out currentValue); Console.WriteLine($"Left/ExposureTime current value: {currentValue.SingleValue}");Enumeration feature
CameraFeature feature; cc.GetFeature("DeviceLinkHeartbeatMode", out feature); CameraValue currentValue; feature.GetValue(out currentValue); Console.WriteLine($"DeviceLinkHeartbeatMode current value: {currentValue.SingleValue}");Boolean feature
CameraFeature feat; cc.GetFeature("Texture/BalanceWhiteAuto", out feat); feat.SetValue(new CameraValue(CameraValueType.Int64, 31)); CameraValue currentValue; feat.GetValue(out currentValue); Console.WriteLine($"Texture/BalanceWhiteAuto current value: {currentValue.SingleValue}");
SetValue()
Sets the value of a feature.
Integer feature
CameraFeature feat; status = cc.GetFeature("DepthSgbmTextureFilterValueOffset", out feat); feat.SetValue(new CameraValue(CameraValueType.Int64, 31));
Float feature
CameraFeature feat; cc.GetFeature("Left/ExposureTime", out feat); feat.SetValue(new CameraValue(CameraValueType.Double, 31));
Enumeration feature
CameraFeature feat; cc.GetFeature("DeviceLinkHeartbeatMode", out feat); feat.SetValue(new CameraValue(CameraValueType.String, "On"));
Boolean feature
CameraFeature feat; cc.GetFeature("Texture/BalanceWhiteAuto", out feat); feat.SetValue(new CameraValue(CameraValueType.Bool, false)); Console.WriteLine($"Set status: {status}");
Range Query Methods
GetRange()
Retrieves the value range of a feature. Applicable to integer and floating-point features.
Integer features
CameraFeature feat; status = cc.GetFeature("DepthSgbmTextureFilterValueOffset", out feat); Int64Range range; CameraApiStatus ret = feat.GetRange(out range); if (ret == CameraApiStatus.Success) { Console.WriteLine($"GetRange success : [{range.Min}, {range.Max}], Step: {range.Step}"); }Floating-point features
CameraFeature feat; status = cc.GetFeature("Left/ExposureTime", out feat); Float64Range range; CameraApiStatus ret = feat.GetRange(out range); if (ret == CameraApiStatus.Success) { Console.WriteLine($"GetRange success : [{range.Min}, {range.Max}], Step: {range.Step}"); }
Enumeration Item Methods
GetEnumItems()
Retrieves all enumeration items of an enumeration feature.
CameraFeature feature;
cc.GetFeature("DeviceLinkHeartbeatMode", out feature);
List<EnumItem> enumItems = new List<EnumItem>();
status = feature.GetEnumItems(enumItems);
if (status == CameraApiStatus.Success)
{
foreach (var item in enumItems)
{
Console.WriteLine($"Name: {item.Name}, Value: {item.Value}");
}
}
else
{
Console.WriteLine($"GetEnumItems failed: {status}");
}
Applicable to: Enumeration features