Focus
Top  Previous  Next

Description

Returns or sets the row value of the focus


Syntax


[VB]
objActiveDcam.Focus [= Value]


[C/C++]
HRESULT get_Focus( long *pFocus );
HRESULT put_Focus( long Focus );



Data Type
[VB]

Long

Parameters
[C/C++]

pFocus [out,retval]  
Pointer to the current focus value  
Focus [in]  
The focus value to be set  


Return Values


S_OK  
Success  
E_FAIL  
The focus control is not available for the selected camera  
E_INVALIDARG  
The value is out of range  
 

Example


The following VB example demonstrates the use of a scroll control for real-time adjustment of the camera's focus.

Private Sub
 Form_Load()

ActiveDcam1.Acquire=
True

HScroll1.Value = ActiveDcam1.Focus
HScroll1.Min = ActiveDcam1.GetFocusMin
HScroll1.Max = ActiveDcam1.GetFocusMax
End Sub


Private Sub
 HScroll1_Scroll()

ActiveDcam1.Focus = HScroll1.Value

End Sub

 

Remarks


This property provides adjustment of the camera's lens to the subject distance. The valid property range is reported by the GetFocusMin and GetFocusMax methods. Note that the property is available only if the currently selected camera is equipped with a motorized lens supports software focus control.