Resource Base
Table of contents

This documentation is deprecated. It applies only to legacy version 2.x of Capture Vision and must not be used for new development.

Please refer to the latest documentation and Migration Guide, which supersede this content.

CameraEnhancer - Create and Destroy Instances

Name Description
static createInstance() Initializes a new instance of the CameraEnhancer class.
dispose() Releases all resources used by the CameraEnhancer instance.
disposed Returns whether the CameraEnhancer instance has been disposed of.

createInstance

Initializes a new instance of the CameraEnhancer class.

static createInstance(cameraView?: CameraView): Promise<CameraEnhancer>;

Parameters

cameraView: [Optional] specifies a CameraView instance to be used by the CameraEnhancer instance.

Return value

A promise that resolves with the initialized CameraEnhancer instance.

Code Snippet

(async () => {
    let cameraView = await Dynamsoft.DCE.CameraView.createInstance();
    let cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView);
})();

See also

dispose

CameraView

dispose

Releases all resources used by the CameraEnhancer instance. Subsequently, the instance retains only the disposed property, set to true.

dispose(): void;

Parameters

None.

Return value

None.

Code Snippet

let cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance();
// Use the object to perform some tasks
//...
cameraEnhancer.dispose();

See also

disposed

disposed

Returns whether the CameraEnhancer instance has been disposed of.

readonly disposed: boolean; 

Return value

Boolean indicating whether the CameraEnhancer instance has been disposed of.

Code Snippet

let cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance();
//...
let flag = cameraEnhancer.disposed;

See also

dispose

onWarning

Event triggered when the running environment is not ideal.

static onWarning: (warning: Warning) => {};

In this version, it may get triggered in two scenarios:

  1. If the page is opened from the disk;
  2. The page is hosted in a HTTP site without SSL;

The following two warnings are returned respectively:

{
    id: 1,
    message: "The page is opened over file:// and Dynamsoft Camera Enhancer may not work properly. Please open the page via https://."
}
{
    id: 2,
    message: "Dynamsoft Camera Enhancer may not work properly in a non-secure context. Please open the page via https://."
}

Code Snippet

Dynamsoft.DCE.CameraEnhancer.onWarning = warning => console.log(warning);

See also

Warning

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: