GetFormatList
Top  Previous  Next

Description

Returns the array of strings containing the descriptions of pixel formats supported by the currently selected camera.


Syntax


[VB]
Value=objActiveGeni.GetFormatList()


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


Data Types
[VB]

Return value: Variant (SAFEARRAY)


Parameters
[C/C++]

pList [out,retval]  
Pointer to the SAFEARRAY of strings containing available formats  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This VB example initializes a combo box with the descriptions of available pixel formats and uses it to select a specific format:

Private Sub
 Form_Load()
FmtLst = ActiveGeni1.GetFmtList
For
 i = 0 
To
 UBound(FmtLst)
Combo1.AddItem (FmtLst(i))
Next
Combo1.ListIndex = 0
ActiveGeni1.Acquire = 
True
End Sub

Private Sub
 Combo1_Click()
ActiveGeni1.Format = Combo1.ListIndex
End Sub

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

VARIANT m_FormatArray=m_ActiveGeni.GetFormatList();
SAFEARRAY *pArray=m_FormatArray.parray;
UINT nFormats=pArray->rgsabound[0].cElements;

CString str;
CComboBox *pFormat=(CComboBox*)GetDlgItem(IDC_FORMAT);
for(UINT i=0;i<nFormats;i++)
{
   pFormat->AddString(strFormat);
}
int iFormat=m_ActiveGeni.GetFormat();
pFormat->SetCurSel(iFormat);


SafeArrayDestroy(pArray);


 

Remarks


The format list is built in the acceding order by browsing through all pixel formats supported by the current camera. The index of an element in the Format list can be used as an argument of the Format property to select a specific pixel format.

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