Resource Base
Table of contents

CameraEnhancer - UI

Name Description
convertToPageCoordinates Converts coordinates from the video’s coordinate system to coordinates relative to the whole page.
convertToClientCoordinates Converts coordinates from the video’s coordinate system to coordinates relative to the viewport.
setCameraView Sets the CameraView instance to be used with the CameraEnhancer.
getCameraView Retrieves the current CameraView instance associated with the CameraEnhancer.
getVideoEl Retrieves the HTMLVideoElement used by the CameraEnhancer for displaying the camera feed.

convertToPageCoordinates

Converts coordinates from the video’s coordinate system to coordinates relative to the whole page.

This is useful for overlaying HTML elements on top of specific points in the video, aligning with the page’s layout.

convertToPageCoordinates(point: Point): Point;

Parameters

point: a Point object representing the x and y coordinates within the video’s coordinate system.

Return value

A Point object representing the converted x and y coordinates relative to the page.

Code Snippet

cameraEnhancer.convertToPageCoordinates({x: 0, y: 0});

See also

Point

convertToClientCoordinates

Converts coordinates from the video’s coordinate system to coordinates relative to the viewport.

This is useful for positioning HTML elements in relation to the video element on the screen, regardless of page scrolling.

convertToClientCoordinates(point: Point): Point;

Parameters

point: a Point object representing the x and y coordinates within the video’s coordinate system.

Return value

A Point object representing the converted x and y coordinates relative to the viewport.

Code Snippet

cameraEnhancer.convertToClientCoordinates({x: 0, y: 0});

See also

Point

setCameraView

Sets the CameraView instance to be used with the CameraEnhancer.

This method allows for specifying a custom camera view, which can be used to display the camera feed and interface elements.

setCameraView(cameraView: CameraView): void;

Parameters

cameraView: a CameraView instance that will be used to display the camera’s video feed and any associated UI components.

Return value

None.

Code Snippet

let cameraView = await Dynamsoft.DCE.CameraView.createInstance();
cameraEnhancer.setCameraView(cameraView);

See also

CameraView

getCameraView

Retrieves the current CameraView instance associated with the CameraEnhancer.

This method allows for accessing the camera view, which can be useful for manipulating the view or accessing its properties and methods.

getCameraView(): CameraView;

Parameters

None.

Return value

The current CameraView instance used by the CameraEnhancer.

Code Snippet

let cameraView = cameraEnhancer.getCameraView();
cameraView.getVisibleRegionOfVideo();

See also

CameraView

getVideoEl

Retrieves the HTMLVideoElement used by the CameraEnhancer for displaying the camera feed.

This method provides direct access to the video element, enabling further customization or interaction with the video stream.

getVideoEl(): HTMLVideoElement;

Parameters

None.

Return value

The HTMLVideoElement that is being used to display the camera’s video feed.

Code Snippet

let videoElement = cameraEnhancer.getVideoEl();

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version(4.0.2)
  • Version 4.x
    • Version 4.0.1
    • Version 4.0.0
  • Version 3.x
    • Version 3.3.10
    • Version 3.3.9
    • Version 3.3.8
    • Version 3.3.7
    • Version 3.3.6
    • Version 3.3.5
    • Version 3.3.4
    • Version 3.3.3
    • Version 3.3.2
    • Version 3.3.1
    • Version 3.3.0
    • Version 3.2.0
    • Version 3.1.0
    • Version 3.0.1
    • Version 3.0.0
  • Version 2.x
    • Version 2.3.5
    • Version 2.3.2
    • Version 2.3.1
    • Version 2.3.0
    • Version 2.1.4
    • Version 2.1.3
    • Version 2.1.0
    • Version 2.0.0
Change +