- Code: Select all Expand view
- //-------------- --------------------------------------------------------------//
#include "Fivewin.ch"
#include "WebCam.ch"
//----------------------------------------------------------------------------//
Function Main ()
Local oWnd, oMenu, oWebCam
MENU oMenu 2007
MENUITEM "&Opções"
MENU
MENUITEM "Ligar" ACTION oWebCam:Initialize();
WHEN !oWebCam:isConnected
MENUITEM "Desligar" ACTION oWebCam:Finalize();
WHEN oWebCam:isConnected
SEPARATOR
MENUITEM "Salvar Imagem" ACTION oWebCam:SaveFile();
WHEN oWebCam:isConnected
SEPARATOR
MENUITEM "Controle de Video" ACTION oWebCam:VideoControl();
WHEN oWebCam:isConnected
MENUITEM "Formatação de Video" ACTION oWebCam:Configuration();
WHEN oWebCam:isConnected
SEPARATOR
MENUITEM "Sair" ACTION oWnd:End()
ENDMENU
MENUITEM "&Option"
MENU
MENUITEM "Start" ACTION oWebCam:Initialize();
WHEN !oWebCam:isConnected
MENUITEM "Stop" ACTION oWebCam:Finalize();
WHEN oWebCam:isConnected
SEPARATOR
MENUITEM "Save Picture" ACTION oWebCam:SaveFile();
WHEN oWebCam:isConnected
SEPARATOR
MENUITEM "Video Control" ACTION oWebCam:VideoControl();
WHEN oWebCam:isConnected
MENUITEM "Video Format" ACTION oWebCam:VideoFormat();
WHEN oWebCam:isConnected
SEPARATOR
MENUITEM "Exit" ACTION oWnd:End()
ENDMENU
ENDMENU
DEFINE WINDOW oWnd TITLE "Sample Class TWebCam" MENU oMenu PIXEL
DEFINE WEBCAM oWebCam FROM 0,0 TO 640,480 OF oWnd
SET MESSAGE OF oWnd TO oWebCam:cName+Space(6)+oWebCam:cVersion 2007
ACTIVATE window oWnd Maximized
oWebCam:Destroy()
Return Nil
//----------------------------------------------------------------------------//