Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
%Unicode = 1
#Include "Win32API.inc"
#Include Once "dshow.inc"
#Include Once "dshow_utilities.inc"
Function PBMain() As Long
Dialog New Pixels, 0, "Right Click to See Camera Supported Formats (24 bit): ",,,640,480, %WS_OverlappedWindow Or %WS_ClipChildren To hDlg
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local w,h,fBits As Long
Select Case Cb.Msg
Case %WM_InitDialog
DisplayFirstCamera
GetCurrentFormat(w,h,fBits)
Dialog Set Text hDlg, "Right Click to See Camera Supported Formats (24 bit): " + Str$(w) + Str$(h) + Str$(fBits)
Case %WM_ContextMenu
GetSupportedFormats
ShowSupportedFormats
End Select
End Function
Sub ShowSupportedFormats()
Local temp$, i As Long
For i = 0 To UBound(SF)
If SF(i).bits <> 24 Then Iterate For 'show only 24 bit formats
temp$ += Str$(i) + Str$(SF(i).w) + "x" + LTrim$(Str$(SF(i).h)) + Str$(SF(i).bits) + $CrLf
Next i
? "# Capabilities " + Str$(UBound(SF)+1) + $CrLf + temp$
End Sub
http://www.garybeene.com/sw/gbsnippets.htm