GetModeList
Top  Previous  Next

Description

Returns the array of strings containing the descriptions of video modes supported by the currently selected camera.


Syntax


[VB]
Value=objActiveDcam.GetModeList()


[C/C++]
HRESULT GetModeList( VARIANT* pList );


Data Types
[VB]

Return value: Variant (SAFEARRAY)


Parameters
[C/C++]

pList [out,retval]  
Pointer to the SAFEARRAY containing available modes  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This VB example initializes a combo box with the descriptions of available video modes and uses it to select a specific mode:

Private Sub
 Form_Load()
ModeLst = ActiveDcam1.GetModeList
For
 i = 0 
To
 UBound(ModeLst)
Combo1.AddItem (ModeLst(i))
Next
Combo1.ListIndex = 0
ActiveDcam1.Acquire = 
True
End Sub

Private Sub
 Combo1_Click()
ActiveDcam1.Mode = Combo1.ListIndex
End Sub

This MFC example fills out a combo box with available video modes:

VARIANT m_ModeArray=m_ActiveDcam.GetModeList();
SAFEARRAY *pArray=m_ModeArray.parray;
UINT nModes=pArray->rgsabound[0].cElements;

CString strMode;
CComboBox *pMode=(CComboBox*)GetDlgItem(IDC_MODE);
for(UINT i=0;i<nModes;i++)
{
   pMode->AddString(strMode);
}
int iMode=m_ActiveDcam.GetMode();
pMode->SetCurSel(iMode);


SafeArrayDestroy(pArray);


 

Remarks


The index of an element in the mode list can be used as an argument of the Mode property to select a specific video mode.

Note that in C/C++ applications it is required to call SafeArrayDestroy() to delete the SAFEARRAY returned by GetModeList.