PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

This page concerns the 23 + version of WINDEV. Upgrade your version.
  • Overview
  • Use example
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Example for managing videos (broadcasted by a Camera control) (object syntax)
Overview
In this example, the application allows you to:
  • view the video sequence currently broadcasted by the camera installed on the current computer.
  • 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 ("File .. New .. Window ").Create a blank window:
    • Click among the quick access buttons.
    • Click "Window" in the wheel that is displayed. The window for creating a new element is displayed: click "Window" then "Window".
    • In the wizard, select "Blank".
  2. In this new window:
    • Create a Camera control named "CAM_Camera" ("Insert .. Control .. Camera control").Create a Camera control named "CAM_Camera": on the "Creation" pane, in the "Graphic controls" group, expand "Video and capture" and click "Camera".Note: By default, the camera associated with this control will correspond to the default camera found on the current computer.
    • Create a button named "BTN_Film" ("Insert .. Control .. Button"). Create a button named "BTN_Film": on the "Creation" pane, in the "Usual controls" group, click "Button".This button will be used to display the video sequence in the Camera control.
    • Create a button named "BTN_Configuration" ("Insert .. Control .. Button").Create a button named "BTN_Configuration": on the "Creation" pane, in the "Usual controls" group, click "Button".This button will be used to modify the configuration of the driver for video capture.
    • Create a button named "BTN_Image" ("Insert .. Control .. Button").Create a button named "BTN_Image": on the "Creation" pane, in the "Usual controls" group, click "Button". This button will be used to save the video sequence currently transmitted in image format (BMP file).
    • Create a button named "BTN_Video" ("Insert .. Control .. Button"). Create a button named "BTN_Video": on the "Creation" pane, in the "Usual controls" group, click "Button". This button will be used to save the video sequence currently transmitted in the format of a video sequence (AVI file).
    • Create a button named "BTN_Stop" ("Insert .. Control .. Button"). Create a button named "BTN_Stop": on the "Creation" pane, in the "Usual controls" group, click "Button".This button will be used to stop displaying and/or saving the video sequence in the Camera control.
  3. Type the following code lines in the click process of "BTN_Film" button:
    // Displays the video sequence currently transmitted in the "CAM_Camera" control
    ResDisplay is boolean
    ResDisplay = CAM_Camera.Display()
    // Displays an error message if a problem occurs
    IF ResDisplay = False THEN Error(ErrorInfo())
  4. Type the following code lines in the click process of "BTN_Configuration" button:
    // Displays the standard dialog box used to
    // configure the driver for video capture used by the "CAM_Camera" control
    CAM_Camera.Configure()
  5. Type the following code lines in the click process of "BTN_Image" button:
    // Save the image currently broadcasted in the "CAM_Camera" control
    ResImgBck is boolean
    ResImgBck = CAM_Camera.Capture("Temp.gif", viPictureCapture)
    IF ResImgBck = False THEN
    Error(ErrorInfo())
    END

    // Select the file to create
    ImageFile is string
    ImageFile = fSelect(fExeDir(), "Image", ...
    "Save as...", "BMP" + TAB + "*.BMP", "bmp", fselCreate + fselExist)

    // Renames the created BMP file
    IF ImageFile ~= "" THEN
    // Delete the temporary file
    fDelete("Temp.BMP")
    ELSE
    // Renames and moves the generated file
    fRename("Temp.BMP", ImageFile)
    END
  6. Type the following code lines in the click process of "BTN_Video" button:
    // Save the video sequence currently broadcasted
    // in the "CAM_Camera" control in the format of a 3-minute AVI
    ResVideoBck is boolean
    ResVideoBck = CAM_Camera.Capture("Temp.avi", viVideoCapture, 180)
    IF ResVideoBck = False THEN
    Error(ErrorInfo())
    END

    // Select the file to create
    VideoFile is string = fSelect(fExeDir(), "Video", ...
    "Save as...", "AVI" + TAB + "*.avi", "avi", fselCreate + fselExist)

    // Renames the created AVI file
    IF VideoFile ~= "" THEN
    // Delete the temporary file
    fDelete("Temp.avi")
    ELSE
    // Renames and moves the generated file
    fRename("Temp.avi", ImageFile)
    END
  7. Type the following code lines in the click process of "BTN_Stop" button:
    // Displays the display or the backup of the video sequence
    ResStop is boolean
    ResStop = CAM_Camera.Stop()
    // Displays an error message if a problem occurs
    IF ResStop = False THEN Error(ErrorInfo())
Minimum required version
  • Version 23
Comments
Click [Add] to post a comment