PC SOFT

WINDEV的在线文档

  • Overview
  • Use example
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Example for managing the videos (broadcasted by a Camera control)

Overview
In this example, the application enables 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:
    • Clickamong 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 "创建" pane, in the "显示控件" group, expand "视频和拍摄" and click "Camera".Note: By default, the camera associated with this control will correspond to the default camera on the current computer.
    • Create a button named "BTN_Film" ("Insert .. Control .. Button").Create a button named "BTN_Film": on the "创建" pane, in the "常用控件" group, click "按钮".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 "创建" pane, in the "常用控件" group, click "按钮".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 "创建" pane, in the "常用控件" group, click "按钮".This button will be used to save the video sequence currently broadcasted as an image (BMP file).
    • Create a button named "BTN_Video" ("Insert .. Control .. Button").Create a button named "BTN_Video": on the "创建" pane, in the "常用控件" group, click "按钮".This button will be used to save the video sequence currently broadcasted as a video sequence (AVI file).
    • Create a button named "BTN_Stop" ("Insert .. Control .. Button").Create a button named "BTN_Stop": on the "创建" pane, in the "常用控件" group, click "按钮".This button will be used to stop the display and/or the backup of the video sequence in the Camera control.
  3. Enter the following code lines in the click process of "BTN_Film":
    // Displays the video sequence currently broadcasted in the "CAM_Camera" control
    ResDisplay布尔型
    ResDisplay视频显示CAM_Camera
    // Displays an error message if a problem occurs
    如果ResDisplay,那么错误错误信息())
  4. Enter the following code lines in the click process of the "BTN_Configuration" button:
    // Displays the standard dialog box used to
    // configure the driver for video capture used by the "CAM_Camera" control
    视频配置CAM_Camera
  5. Enter the following code lines in the click process of the "BTN_Image" button:
    // Save the image currently broadcasted in the "CAM_Camera" control
    ResImgBck布尔型
    ResImgBck视频采集CAM_Camera"Temp.gif"视频采集.图片
    如果ResImgBck,那么
    错误错误信息())
    结束

    // Select the file to create
    ImageFile字符串型
    ImageFile文件选择器文件可执行文件目录(),"Image",...
    "Save as...""BMP"+TAB+"*.BMP""bmp"文件选择器.创建+文件选择器.存在

    // Renames the created BMP file
    如果ImageFile约等于"",那么
    // Delete the temporary file
    文件删除"Temp.BMP"
    否则
    // Renames and moves the generated file
    文件重命名"Temp.BMP"ImageFile
    结束
  6. Enter the following code lines in the click process of the "BTN_Video" button:
    // Save the video sequence currently broadcasted
    // in the "CAM_Camera" control in the format of a 3-minute AVI
    ResVideoBck布尔型
    ResVideoBck视频采集CAM_Camera"Temp.avi"视频采集.视频180
    如果ResVideoBck,那么
    错误错误信息())
    结束

    // Select the file to create
    VideoFile字符串型文件选择器文件可执行文件目录(),"Video",...
    "Save as...""AVI"+TAB+"*.avi""avi"文件选择器.创建+文件选择器.存在

    // Renames the created AVI file
    如果VideoFile约等于"",那么
    // Delete the temporary file
    文件删除"Temp.avi"
    否则
    // Renames and moves the generated file
    文件重命名"Temp.avi"ImageFile
    结束
  7. Enter the following code lines in the click process of the "BTN_Stop" button:
    // Displays the display or the backup of the video sequence
    ResStop布尔型
    ResStop视频停止CAM_Camera
    // Displays an error message if a problem occurs
    如果ResStop,那么错误错误信息())