SetFeature
Top  Previous  Next

Description

Sets the value of the specified camera feature.


Syntax


[VB]
objActiveDcam.SetFeature Name, Value


[C/C++]
HRESULT SetFeature(bstr Name, float Value );


Data Types
[VB]

Name: String
Value
: Single


Parameters
[C/C++]

Name [in]  
String specifying the name of the feature. In accordance with IIDC 1.31, one of the following names can be used:  
"Brightness", "Exposure", "Sharpness", "WhiteBalanceVR", "WhiteBalanceUB","Hue", "Saturation", "Gamma", "Shutter", "Gain", "Iris", "Focus", "OpticalFilter", "Zoom", "Pan", "Tilt", "Temperature", "TriggerDelay", "WhiteShading".  
 
Value [out, retval]  
Value of the feature to be set  


Return Values


S_OK  
Success  
E_INVALIDARG  
Feature does not exist  
E_OUTOFMEMORY  
Value is out of range  
E_FAIL  
Failure to set the feature  
 

Example


The following VB example demonstrates the use of a scroll control for real-time adjustment of the brigthness feature.

Private Sub
 Form_Load()

ActiveDcam1.Acquire=
True

HScroll1.Value = ActiveDcam1.GetFeature("Brightness")
HScroll1.Min = ActiveDcam1.GetFeatureMin("Brightness")
HScroll1.Max = ActiveDcam1.GetFeatureMax("Brightness")
End Sub


Private Sub
 HScroll1_Scroll()

ActiveDcam1.SetFeature("Brightness", HScroll1.Value)

End Sub

 
The following VB example demonstrates the use of the absolute control of the shutter:

ActiveDcam1.SetFeatureControl "Shutter", "Absolute",
True

ActiveDcam1.SetFeature "Shutter", 0.025
ActiveDcam1.SetFeatureControl "Shutter", "Absolute"
, False


Remarks


Depending on the absolute feature control being enabled or disabled, this method will set the value of the feature in absolute or relative units.

If the currently selected camera does not support the specified feature or if the feature is read-only, the method will generate an error.