Webcam Capture

Methods
Addon.Webcam.CaptureImage() Addon.Webcam.CloseSource()
Addon.Webcam.Download() Addon.Webcam.GetCameraControlPropertyMoreSetting()
Addon.Webcam.GetCameraControlPropertySetting() Addon.Webcam.GetFrameRate()
Addon.Webcam.GetFramePartURL() Addon.Webcam.GetFrameURL()
Addon.Webcam.GetMediaType() Addon.Webcam.GetResolution()
Addon.Webcam.GetSourceList() Addon.Webcam.GetVideoPropertyMoreSetting()
Addon.Webcam.GetVideoPropertySetting() Addon.Webcam.PauseVideo()
Addon.Webcam.PlayVideo() Addon.Webcam.SelectSource()
Addon.Webcam.SetCameraControlPropertySetting() Addon.Webcam.SetFrameRate()
Addon.Webcam.SetMediaType() Addon.Webcam.SetResolution()
Addon.Webcam.SetVideoPropertySetting() Addon.Webcam.SetVideoRotateMode()
Addon.Webcam.StopVideo()

Methods

Addon.Webcam.CaptureImage()
Captures an image from the current Webcam.
Syntax .Addon.Webcam.CaptureImage(OnCaptureSuccess, OnCaptureError);
Parameters Function OnCaptureSuccess: callback function fired when capturing suceeds.
Function OnCaptureError: callback function fired when capturing fails.
Return value Void
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.CloseSource()
Closes the current Webcam Source.
Syntax .Addon.Webcam.CloseSource();
Parameters None
Return value Boolean
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Usage notes When you close the camera, the video stream will also stop at the last frame.
Addon.Webcam.Download()
Downloads and installs Webcam add-on (it's typically a zipped dll file) on the local system.
Syntax .Addon.Webcam.Download(strFilePath, [optionalAsyncSuccessFunc, optionalAsyncFailureFunc]);
Parameters string strFilePath: the path of the .zip file that contains the Webcam add-on.
The following two parameters are optional. If either one exists or both exist, the method is asynchronous, otherwise it's synchronous.
<OnSuccess function> optional optionalAsyncSuccessFunc: callback function triggered when the file is downloaded successfully.
<OnFailure function> optional optionalAsyncFailureFunc: callback function triggered when the file failed to be downloaded.
Please refer to the function prototype OnSuccess or OnFailure.
Return value boolean, only valid when used synchronnously.
Usage notes The download will occur when the Webcam add-on doesn't exist on the local machine or the local add-on is of a different version.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.GetCameraControlPropertyMoreSetting()
Returns the range and default values of a specified Webcam property.
Syntax .Addon.Webcam.GetCameraControlPropertyMoreSetting(nProperty);
Parameters number nProperty: specifies the property to query. Allowed values are
Values EnumDWT_CameraControlProperty Description
0 CCP_PAN Specifies the camera's pan setting, in degrees. Values range from –180 to +180, with the default set to zero. Positive values are clockwise from the origin (the camera rotates clockwise when viewed from above), and negative values are counterclockwise from the origin.
1 CCP_TILT Specifies the camera's tilt setting, in degrees. Values range from –180 to +180, with the default set to zero. Positive values point the imaging plane up, and negative values point the imaging plane down.
2 CCP_ROLL Specifies the camera's roll setting, in degrees. Values range from –180 to +180, with the default set to zero. Positive values cause a clockwise rotation of the camera along the image-viewing axis, and negative values cause a counterclockwise rotation of the camera.
3 CCP_ZOOM Specifies the camera's zoom setting, in millimeters. Values range from 10 to 600, and the default is specific to the device.
4 CCP_EXPOSURE Specifies the exposure setting, in log base 2 seconds. In other words, for values less than zero, the exposure time is 1/2^n seconds, and for values zero or above, the exposure time is 2^n seconds. For example:
Value Seconds
  -3     1/8
  -2     1/4
  -1     1/2
  0        1
  1        2
  2        4
5 CCP_IRIS Specifies the camera's iris setting, in units of fstop* 10.
6 CCP_FOCUS Specifies the camera's focus setting, as the distance to the optimally focused target, in millimeters. The range and default value are specific to the device.
Return value An object of the type CameraControlMoreSetting is returned. Methods available in the object are
Data Type Method Name Description
<long> GetMinValue() Returns the minimum value of the property.
<long> GetMaxValue() Returns the maximum value of the property.
<long> GetSteppingDelta() Returns the step size for the property. The step size is the smallest increment by which the property can change.
<long> GetDefaultValue() Returns the default value of the property.
<Boolean> GetIfAuto() Returns a value that indicates whether the setting is controlled manually or automatically.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.GetCameraControlPropertySetting()
Returns the basic settings of a camera property.
Syntax .Addon.Webcam.GetCameraControlPropertySetting(nProperty);
Parameters number nProperty: specifies the property to query. Allowed values are
Values EnumDWT_CameraControlProperty Description
0 CCP_PAN Specifies the camera's pan setting, in degrees. Values range from –180 to +180, with the default set to zero. Positive values are clockwise from the origin (the camera rotates clockwise when viewed from above), and negative values are counterclockwise from the origin.
1 CCP_TILT Specifies the camera's tilt setting, in degrees. Values range from –180 to +180, with the default set to zero. Positive values point the imaging plane up, and negative values point the imaging plane down.
2 CCP_ROLL Specifies the camera's roll setting, in degrees. Values range from –180 to +180, with the default set to zero. Positive values cause a clockwise rotation of the camera along the image-viewing axis, and negative values cause a counterclockwise rotation of the camera.
3 CCP_ZOOM Specifies the camera's zoom setting, in millimeters. Values range from 10 to 600, and the default is specific to the device.
4 CCP_EXPOSURE Specifies the exposure setting, in log base 2 seconds. In other words, for values less than zero, the exposure time is 1/2^n seconds, and for values zero or above, the exposure time is 2^n seconds. For example:
Value Seconds
  -3     1/8
  -2     1/4
  -1     1/2
  0        1
  1        2
  2        4
5 CCP_IRIS Specifies the camera's iris setting, in units of fstop* 10.
6 CCP_FOCUS Specifies the camera's focus setting, as the distance to the optimally focused target, in millimeters. The range and default value are specific to the device.
Return value An object of the type CameraControlSetting is returned. Methods available in the object are
Data Type Method Name Description
<Number> GetValue() Returns the value of the property.
<Boolean> GetIfAuto() Returns a value that indicates whether the setting is controlled manually or automatically.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.GetFrameRate()
Retrieves the frame rates supported by the current Webcam.
Syntax .Addon.Webcam.GetFrameRate();
Parameters None
Return value An object of the type WebcamFrameRate is returned which contains a list of all available frame rates. Methods available in the object are
Data Type Method Name Description
<Number> GetCount() Returns the count of available frame rates.
<String> Get(Number index) Returns a frame rate from the list.
<String> GetCurrent() Returns the current frame rate.
Usage notes This method should be called after Addon.Webcam.SelectSource(). If there is only one data source available, it will be selected automatically.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1
Addon.Webcam.GetFramePartURL()
Gets the internal URL (dwt://) of the latest frame of the video stream.
Syntax .Addon.Webcam.GetFramePartURL();
Parameters None
Return value String
Usage notes The returned URL will be like "dwt://dwt_trial_13000404/img?id=306159652&index=0&t=1502184632022".
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3.1
Addon.Webcam.GetFrameURL()
Gets the URL (http(s)://) of the latest frame of the video stream.
Syntax .Addon.Webcam.GetFrameURL();
Parameters None
Return value String
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1
Addon.Webcam.GetMediaType()
Retrieves the media types supported by the current Webcam.
Syntax .Addon.Webcam.GetMediaType();
Parameters None
Return value An object of the type WebcamMediaType is returned which contains a list of all available media types. Methods available in the object are
Data Type Method Name Description
<Number> GetCount() Returns the count of available media types.
<String> Get(Number index) Returns a media type from the list.
<String> GetCurrent() Returns the current media type.
Usage notes This method should be called after Addon.Webcam.SelectSource(). If there is only one data source available, it will be selected automatically.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.GetResolution();
Retrieves the resolutions supported by the current Webcam.
Syntax .Addon.Webcam.GetResolution()
Parameters None
Return value An object of the type WebcamResolution is returned which contains a list of all available resolutions. Methods available in the object are
Data Type Method Name Description
<Number> GetCount() Returns the count of available resolutions.
<String> Get(Number index) Returns a resolution from the list.
<String> GetCurrent() Returns the current resolution.
Usage notes This method should be called after Addon.Webcam.SelectSource(). If there is only one data source available, it will be selected automatically.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.GetSourceList()
Gets a list of all available Webcams.
Syntax .Addon.Webcam.GetSourceList();
Parameters None
Return value String[] An array of strings containing all Webcam names e.g. ["HD Webcam", "HP Webcam 123", "USB video driver"].
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Usage notes When you call this method, the camera addon will be restored. In other words, the video stream will be cut off and the selected camera will be deselected and previous settings will be lost.
Addon.Webcam.GetVideoPropertyMoreSetting()
Returns the range and default values of a specified video property.
Syntax .Addon.Webcam.GetVideoPropertyMoreSetting(nProperty);
Parameters number nProperty: Specifies the property to query, allowed values are:
Values EnumDWT_VideoProperty Description
0 VP_BRIGHTNESS Specifies the brightness, also called the black level. For NTSC, the value is expressed in IRE units * 100. For non-NTSC sources, the units are arbitrary, with zero representing blanking and 10,000 representing pure white. Values range from –10,000 to 10,000.
1 VP_CONTRAST Specifies the contrast, expressed as gain factor * 100. Values range from zero to 10,000.
2 VP_HUE Specifies the hue, in degrees * 100. Values range from -180,000 to 180,000 (-180 to +180 degrees).
3 VP_SATURATION Specifies the saturation. Values range from 0 to 10,000.
4 VP_SHARPNESS Specifies the sharpness. Values range from 0 to 100.
5 VP_GAMMA Specifies the gamma, as gamma * 100. Values range from 1 to 500.
6 VP_COLORENABLE Specifies the color enable setting. The possible values are 0 (off) and 1 (on).
7 VP_WHITEBALANCE Specifies the white balance, as a color temperature in degrees Kelvin. The range of values depends on the device.
8 VP_BACKLIGHTCOMPENSATION Specifies the backlight compensation setting. Possible values are 0 (off) and 1 (on).
9 VP_GAIN Specifies the gain adjustment. Zero is normal. Positive values are brighter and negative values are darker. The range of values depends on the device.
Return value An object of the type VideoPropertyMoreSetting is returned. Methods available in the object are
Data Type Method Name Description
<Number> GetMinValue() Returns the minimum value of the property.
<Number> GetMaxValue() Returns the maximum value of the property.
<Number> GetSteppingDelta() Returns the step size for the property. The step size is the smallest increment by which the property can change.
<Number> GetDefaultValue() Returns the default value of the property.
<Boolean> GetIfAuto() Returns a value that indicates whether the setting is controlled manually or automatically.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.GetVideoPropertySetting()
Returns the basic settings of a video property.
Syntax .Addon.Webcam.GetVideoPropertySetting(nProperty);
Parameters number nProperty: Specifies the property to query, allowed values are:
Values EnumDWT_VideoProperty Description
0 VP_BRIGHTNESS Specifies the brightness, also called the black level. For NTSC, the value is expressed in IRE units * 100. For non-NTSC sources, the units are arbitrary, with zero representing blanking and 10,000 representing pure white. Values range from –10,000 to 10,000.
1 VP_CONTRAST Specifies the contrast, expressed as gain factor * 100. Values range from zero to 10,000.
2 VP_HUE Specifies the hue, in degrees * 100. Values range from -180,000 to 180,000 (-180 to +180 degrees).
3 VP_SATURATION Specifies the saturation. Values range from 0 to 10,000.
4 VP_SHARPNESS Specifies the sharpness. Values range from 0 to 100.
5 VP_GAMMA Specifies the gamma, as gamma * 100. Values range from 1 to 500.
6 VP_COLORENABLE Specifies the color enable setting. The possible values are 0 (off) and 1 (on).
7 VP_WHITEBALANCE Specifies the white balance, as a color temperature in degrees Kelvin. The range of values depends on the device.
8 VP_BACKLIGHTCOMPENSATION Specifies the backlight compensation setting. Possible values are 0 (off) and 1 (on).
9 VP_GAIN Specifies the gain adjustment. Zero is normal. Positive values are brighter and negative values are darker. The range of values depends on the device.
Return value An object of the type VideoPropertySetting is returned. Methods available in the object are
Data Type Method Name Description
<Number> GetValue() Returns the current value of the property.
<Boolean> GetIfAuto() Returns a value that indicates whether the setting is controlled manually or automatically.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.PauseVideo()
Pauses the video stream.
Syntax .Addon.Webcam.PauseVideo();
Parameters None
Return value Boolean
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3
Usage notes This method only pauses the video for the HTML5 edition. Also, when you capture an image, it'll be based on the actual frame at that point from the camera, not the paused frame.
Addon.Webcam.PlayVideo()
Starts to play the video stream in a specified container.
Syntax .Addon.Webcam.PlayVideo(DWObject, nQuality ,onFrameCaptured);
Parameters Object DWObject: Specifies the object to hold the video stream.
number nQuality: Specifies the quality of each frame in the video stream. Only valid for the HTML5 edition.
optional Function onFrameCaptured: Specifies the callback function for each showing frame in the video stream.
Return value None
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.SelectSource()
Selects an available Webcam.
Syntax .Addon.Webcam.SelectSource(strWebcamName);
Parameters string strWebcamName: specifies the Webcam to select.
Return value Boolean
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.SetCameraControlPropertySetting()
Sets a property for the current camera.
Syntax .Addon.Webcam.SetCameraControlPropertySetting(nProperty, nValue, bAuto);
Parameters number nProperty: specifies the property to change. Allowed values are
Values EnumDWT_CameraControlProperty Description
0 CCP_PAN Specifies the camera's pan setting, in degrees. Values range from –180 to +180, with the default set to zero. Positive values are clockwise from the origin (the camera rotates clockwise when viewed from above), and negative values are counterclockwise from the origin.
1 CCP_TILT Specifies the camera's tilt setting, in degrees. Values range from –180 to +180, with the default set to zero. Positive values point the imaging plane up, and negative values point the imaging plane down.
2 CCP_ROLL Specifies the camera's roll setting, in degrees. Values range from –180 to +180, with the default set to zero. Positive values cause a clockwise rotation of the camera along the image-viewing axis, and negative values cause a counterclockwise rotation of the camera.
3 CCP_ZOOM Specifies the camera's zoom setting, in millimeters. Values range from 10 to 600, and the default is specific to the device.
4 CCP_EXPOSURE Specifies the exposure setting, in log base 2 seconds. In other words, for values less than zero, the exposure time is 1/2^n seconds, and for values zero or above, the exposure time is 2^n seconds. For example:
Value Seconds
  -3     1/8
  -2     1/4
  -1     1/2
  0        1
  1        2
  2        4
5 CCP_IRIS Specifies the camera's iris setting, in units of fstop* 10.
6 CCP_FOCUS Specifies the camera's focus setting, as the distance to the optimally focused target, in millimeters. The range and default value are specific to the device.
number nValue: Specifies the value to set to the property. boolean bAuto: Specifies whether the setting is controlled manually or automatically.
Return value Boolean
Usage notes This method should be called after Addon.Webcam.SelectSource(). If there is only one data source available, it will be selected automatically.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.SetFrameRate()
Sets the frame rate of the current Webcam.
Syntax .Addon.Webcam.SetFrameRate(nValue);
Parameters number nValue: Specifies the frame rate.
Return value Boolean
Usage notes This method should be called after Addon.Webcam.SelectSource(). If there is only one data source available, it will be selected automatically.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.SetMediaType()
Sets the media type of the current Webcam.
Syntax .Addon.Webcam.SetMediaType(strMediaType);
Parameters string strMediaType: Specifies the media type.
Return value Boolean
Usage notes This method should be called after Addon.Webcam.SelectSource(). If there is only one data source available, it will be selected automatically. Make sure you only set a supported media type which you can get using the method Addon.Webcam.GetMediaType().
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.SetResolution()
Sets the resolution of the current Webcam.
Syntax .Addon.Webcam.SetResolution(strResolution)
Parameters string strResolution: Specifies the resolution.
Return value Boolean
Usage notes This method should be called after Addon.Webcam.SelectSource(). If there is only one data source available, it will be selected automatically. Make sure you only set a supported resolution which you can get using the method Addon.Webcam.GetResolution().
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.SetVideoPropertySetting()
Sets a property for the video stream.
Syntax .Addon.Webcam.SetVideoPropertySetting(nProperty, nValue, bAuto);
Parameters number nProperty: Specifies the property to change, allowed values are:
Values EnumDWT_VideoProperty Description
0 VP_BRIGHTNESS Specifies the brightness, also called the black level. For NTSC, the value is expressed in IRE units * 100. For non-NTSC sources, the units are arbitrary, with zero representing blanking and 10,000 representing pure white. Values range from –10,000 to 10,000.
1 VP_CONTRAST Specifies the contrast, expressed as gain factor * 100. Values range from zero to 10,000.
2 VP_HUE Specifies the hue, in degrees * 100. Values range from -180,000 to 180,000 (-180 to +180 degrees).
3 VP_SATURATION Specifies the saturation. Values range from 0 to 10,000.
4 VP_SHARPNESS Specifies the sharpness. Values range from 0 to 100.
5 VP_GAMMA Specifies the gamma, as gamma * 100. Values range from 1 to 500.
6 VP_COLORENABLE Specifies the color enable setting. The possible values are 0 (off) and 1 (on).
7 VP_WHITEBALANCE Specifies the white balance, as a color temperature in degrees Kelvin. The range of values depends on the device.
8 VP_BACKLIGHTCOMPENSATION Specifies the backlight compensation setting. Possible values are 0 (off) and 1 (on).
9 VP_GAIN Specifies the gain adjustment. Zero is normal. Positive values are brighter and negative values are darker. The range of values depends on the device.
number nValue: Specifies the value to set to the property. boolean bAuto: Specifies whether the setting is controlled manually or automatically.
Return value Boolean
Usage notes This method should be called after Addon.Webcam.SelectSource(). If there is only one data source available, it will be selected automatically.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.SetVideoRotateMode()
Sets video rotate mode of the current Webcam.
Syntax .Addon.Webcam.SetVideoRotateMode(nVideoRotateMode);
Parameters number nVideoRotateMode: Specifies the video rotate mode on a video capture device, allowed values are:
Values EnumDWT_VideoRotateMode enumeration Description
0 VRM_NONE Don't rotate
1 VRM_90_DEGREES_CLOCKWISE 90 deg Clockwise
2 VRM_180_DEGREES_CLOCKWISE 180 deg Clockwise
3 VRM_270_DEGREES_CLOCKWISE 270 deg Clockwise
4 VRM_FLIP_VERTICAL Flip
5 VRM_FLIP_HORIZONTAL Mirror
Return value Boolean
Usage notes This method should be called after Addon.Webcam.SelectSource(). If there is only one data source available, it will be selected automatically.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3
Addon.Webcam.StopVideo()
Stops the video stream.
Syntax .Addon.Webcam.StopVideo();
Parameters None
Return value Boolean
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1✓ | v14.3

results matching ""

    No results matching ""

    results matching ""

      No results matching ""