SetFeature
Top  Previous  Next

Description

Sets the numerical value of the specified camera feature.


Syntax


[VB]
objActiveGeni.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  
Value [out, retval]  
Numerical value of the feature to be set  


Return Values


S_OK  
Success  
E_NOINTERFACE        
Feature does not exist or not available  
E_INVALIDARG  
Feature is not of numerical type  
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 "GainRaw" feature.

Private Sub
 Form_Load()

ActiveGeni1.Acquire=
True

HScroll1.Value = ActiveGeni1.GetFeature("GainRaw")
HScroll1.Min = ActiveGeni1.GetFeatureMin("GainRaw")
HScroll1.Max = ActiveGeni1.GetFeatureMax("GainRaw")
End Sub


Private Sub
 HScroll1_Scroll()

ActiveGeni1.SetFeature("GainRaw", HScroll1.Value)

End Sub

 

Remarks


Depending on the Type of the feature the Value argument has the following meaning:

Feature Type
Value
Integer
Integer value converted to floating point
Float
Floating point value
Boolean
0. if False, 1. if True
Enumerated
Ordinal number in the enumeration list
String
N/A
Command
Use non-zero value to execute


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

To set the string value of a feature, use SetFeatureString.