xVideo 1.0 CW ManualCopyright (c) 1999 by The Network Connection, Inc.
All Rights Reserved
What is xVideo
Video Capture?
System RequirementsxVideo is an ActiveX Server Control that interfaces with Window's built in video API's. This control greatly simplifies the use of real time video and allows you to capture still images from the live video stream.
A demonstration copy of xVideo can be downloaded from http://www.olis.com/cw.
General Requirements
- Windows 95/98 or Windows NT 4.0+.
- A Windows Video Input Device, such as a camera, video capture device, etc.
- Clarion for Windows version 4.0, 5.0.
Getting Started
Download and install the xVideo demo file. The xVideo.OCX file will be installed and registered in your windows\system directory. A demo CW 5 application will be installed in "C:\Program Files\xVideo". If you need to install the controls on your customer's computer, it is recommended that you use our install, as it installs and registers all needed controls and dlls.
Using xVideo
To use xVideo in a CW application, you must create a 32 bit application and place an instance of the xVideo control on your CW form. Follow the steps below to accomplish this.
- With a CW form displayed select the OLE Control from the Toolbox. Move the curser over the form and place the control on the from by dragging the mouse.
- Right click on the OLE Control and select properties. Check the 32-bit box and select the Ocx radio button. From the Object Type pull down select xVideo.xView. The Ole Property form show look like this:
Sample CW Application
xVideo is shipped with a sample CW Application that allows you to view and capture live video directly from a Window in your CW Program. The application consists of the following files:Using ActivX Controls in CWxVideo.App - CW 5 Demo Application
xVideo.Exe - Compiled CW 5 Demo
When using ActiveX controls in CW, there are three ways to make the ActiveX server do something. You can read a property, set a property and call a method. Most ActiveX controls use methods with parameters. In CW this presents a problem because the syntax is very difficult to code when calling methods with parameters. In our custom written controls for CW, we have converted all methods with parameters to properties.
Most ActiveX controls talk back to their host programs using Events. In CW, Events are a real pain to code, so we have converted all events to the error property. After setting a property or calling a method that could produce an error, you can check the ErrorNum property to see if an error occured.
CW ActiveX Syntax
Property and Method Syntax CW Example Read a Property Value=?OLE{'PropertyName'} Set a Property ?OLE{'PropertyName'}=Value Call a Method ?OLE{'MethodName'}
Object Reference
xVideo Properties
Property and Type Comments ErrorNum as Integer Read Only. Check this property for errors. ErrorDesc as String Read Only. Description of Error. DisplayWidth as Integer Width of Video Display Box in pixels. DisplayHeight as Integer Height of Video Display Box in pixels. StretchPreview as Boolean Write Only. True-Causes the video image to fill the entire display box. This has NO effect on the captured image. Preview as Boolean Write Only. True-Causes the display box to show live video. PreviewRate as Integer Write Only. Frame rate per second. Valid range 1-100. Default=15. NumberDrivers as Integer Read Only. The number of known Windows video input devices attached to the PC. When 0 there are no valid devices. SetDriverNumber as Integer Write Only. Select video input device. This is a zero based selection. For example, if NumberDrivers returns 2, then valid devices are 0 and 1. DriverNumber as Integer Write Only. Select video driver to query. This must be set before using DriverName or DriverVersion. This is a zero based selection. For example, if NumberDrivers returns 2, then valid devices are 0 and 1. DriverName as String Read Only. Returns video capture driver name set with DriverNumber. DriverVersion as String Read Only. Returns video capture driver version set with DriverNumber. CaptureToBmp as String. Write Only. Captures video frame to a BMP file. If no file extension is given, then .BMP will be used. Check ErrorNum after setting this property. CaptureToJpg as String Write Only. Captures video frame to a JPG file. If no file extension is given, then .JPG will be used. Check ErrorNum after setting this property. LastFile as String Read Only. Complete file name of last captured file. HasDlgDisplay as Boolean Read Only. Video Driver has Display Dialog. HasDlgFormat as Boolean Read Only. Video Driver has Format Dialog. HasDlgSource as Boolean Read Only. Video Driver has Source Dialog. ShowDlgVideoDisplay as Boolean Read Only. Show video driver Display Dialog. False if error. ShowDlgVideoFormat as Boolean Read Only. Show video driver Format Dialog. False if error. ShowDlgVideoSource as Boolean Read Only. Show video driver Source Dialog. False if error. Optional AVI Properties
AviTimeLimit as Integer Max time in seconds to record AVI file. (Default=15) AviCapture as String Captures Live Video and Audio to a AVI file. If no file extension is given, then .AVI will be used. Check ErrorNum after setting this property. AviCaptureRate as Integer AVI frame capture rate. (Default=30 frames/second) AviConfirm as Boolean Write Only. If true a confirmation dialog will display before capturing AVI file. AviHasAudio as Boolean Read Only. Audio Driver has Format Dialog. AVIShowDlgAudioFormat as Boolean Read Only. Show audio driver Display Dialog. False if error.
xVideo Methods
Method Name Comments About Show registration and version dialog. CaptureToClipboard Captures video frame to Windows clipboard.