1.1.2 • Published 1 year ago

nativescript-dynamsoft-camera-enhancer v1.1.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

nativescript-dynamsoft-camera-enhancer

Nativescript plugin for Dynamsoft Camera Enhancer.

We can use it for camera preview, which is the base of building a barcode scanner, a text scanner, a document scanner, etc.

Installation

npm install nativescript-dynamsoft-camera-enhancer

Usage

Add the camera view in the layout:

<Page xmlns="http://schemas.nativescript.org/tns.xsd" 
    xmlns:dce="nativescript-dynamsoft-camera-enhancer"
    navigatingTo="navigatingTo" class="page">
    <GridLayout rows="*, auto, auto">
        <dce:CameraEnhancer 
        loaded="{{ dceLoaded }}" 
        rowSpan="3" 
        active="{{ isActive }}"
        cameraID="{{ desiredCamera }}"
        torch="{{ desiredTorchStatus }}"></dce:CameraEnhancer>
    </GridLayout>
</Page>

Get the camera enhancer intanse in the code behind:

dce:CameraEnhancer;
dceLoaded(args: EventData) {
  this.dce = <CameraEnhancer>args.object;
}

Methods:

captureFrame(): any;
captureFrameAsBase64(): string;
getAllCameras(): string[];
getSelectedCamera(): string;
getCameraEnhancer(): any;
getResolution(): Resolution;
setResolution(resolution:Resolution): void;
setZoom(factor:number);
getMaxZoomFactor(): number;
open(): void;
close(): void;

Properties:

active:boolean //whether the camera is open
torch:boolean  //whether the torch is on
cameraID:string //the selected camera ID

Interfaces:

export interface Resolution {
  width: number;
  height: number;
}

License

Apache License Version 2.0

1.1.1

1 year ago

1.1.0

1 year ago

1.1.2

1 year ago

1.0.2

1 year ago

1.0.0

1 year ago