AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Controles: tipos disponibles / Control Cámara
  • Overview
  • Use example
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
In this example, the application allows you to:
  • view the camera preview stream currently being transmitted by the camera installed on the current workstation.
  • modify the configuration of the driver for video capture.
  • save the video currently broadcasted by the specified camera as an image (BMP file) or as a video sequence (AVI file).
Use example
To develop this application:
  1. Create a blank window:
    • Click in the quick access buttons.
    • When the new element window appears, click "Window" then "Window".
    • In the wizard, select "Blank".
  2. In this new window:
    • Create a Camera field named "CAM_Camera": under the "Creación" pane, in the "Controles gráficos" group, scroll down to "Video y captura" and click on "Camera"..
      Note: By default, the camera associated with this field will be the default camera for the current workstation.
    • Create a Button field named "BTN_Filmer": under the "Creación" pane, in the "Controles frecuentes" group, click on "Botón"..
      This Button control will be used to display the video sequence in the Camera control.
    • Create a Button field named "BTN_Configuration": under the "Creación" pane, in the "Controles frecuentes" group, click on "Botón"..
      This Button control will be used to modify the configuration of the driver for video capture.
    • Create a Button field named "BTN_Image": under the "Creación" pane, in the "Controles frecuentes" group, click on "Botón"..
      This Button control will be used to save the video sequence currently transmitted, as an image (BMP file).
    • Create a Button field named "BTN_Video": under the "Creación" pane, in the "Controles frecuentes" group, click on "Botón"..
      This Button control will be used to save the video sequence currently transmitted, as a video sequence (AVI file).
    • Create a Button field named "BTN_Stop": under the "Creación" pane, in the "Controles frecuentes" group, click on "Botón"..
      This Button control will be used to stop displaying and/or saving the video sequence in the Camera control.
  3. Write the following code in the "Click" event of "BTN_Film":
    // Affiche la séquence vidéo actuellement retransmise dans le champ "CAM_Caméra"
    ResAffiche is boolean
    ResAffiche = VideoDisplay(CAM_Caméra)
    // Affiche une erreur en cas de problème
    IF ResAffiche = False THEN Error(ErrorInfo())
  4. Write the following code in the "Click" event of "BTN_Configuration":
    // Affiche la boîte de dialogue standard permettant 
    // la configuration du driver de capture vidéo utilisé pour le champ "CAM_Caméra"
    VideoConfigure(CAM_Caméra)
  5. Write the following code in the "Click" event of "BTN_Image":
    // Sauvegarde de l'image actuellement retransmise dans le champ "CAM_Caméra"
    ResSauvImg is boolean
    ResSauvImg = VideoCapture(CAM_Caméra, "Temp.gif", viPictureCapture)
    IF ResSauvImg = False THEN 
    	Error(ErrorInfo())
    END
    
    // Sélection du fichier à créer
    FichierImage is string 
    FichierImage = fSelect(fExeDir(), "Image", ...
    	"Enregistrer sous...", "BMP" + TAB + "*.BMP", "bmp", fselCreate + fselExist)
    
    // Renomme le fichier BMP créé
    IF FichierImage ~= "" THEN
    	// Suppression du fichier temporaire
    	fDelete("Temp.BMP")
    ELSE
    	// Renomme et déplace le fichier généré
    	fRename("Temp.BMP", FichierImage)
    END
  6. Write the following code in the "Click" event of "BTN_Video":
    // Sauvegarde de la séquence vidéo actuellement retransmise 
    // dans le champ "CAM_Caméra" sous forme d'une AVI de 3 minutes
    ResSauvVidéo is boolean
    ResSauvVidéo = VideoCapture(CAM_Caméra, "Temp.avi", viVideoCapture, 180)
    IF ResSauvVidéo = False THEN 
    	Error(ErrorInfo())
    END
    
    // Sélection du fichier à créer
    FichierVidéo is string = fSélecteur(fExeDir(), "Vidéo", ...
    	"Enregistrer sous...", "AVI" + TAB + "*.avi", "avi", fselCreate + fselExist)
    
    // Renomme le fichier AVI créé
    IF FichierVidéo ~= "" THEN
    	// Suppression du fichier temporaire
    	fDelete("Temp.avi")
    ELSE
    	// Renomme et déplace le fichier généré
    	fRename("Temp.avi", FichierImage)
    END
  7. Write the following code in the "Click" event of "BTN_Stop":
    // Affiche l'affichage ou la sauvegarde de la séquence vidéo
    ResArrête is boolean 
    ResArrête = VideoStop(CAM_Caméra)
    // Affiche une erreur en cas de problème
    IF ResArrête = False THEN Error(ErrorInfo())
Versión mínima requerida
  • Versión 10
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 21/09/2024

Señalar un error o enviar una sugerencia | Ayuda local