mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
feat(camera-preview): add wrapper for camera preview snapshot #3018
feat(camera-preview): add wrapper for camera preview snapshot
This commit is contained in:
commit
56e4a7827f
@ -113,6 +113,14 @@ export interface CameraPreviewPictureOptions {
|
|||||||
* this.picture = 'assets/img/test.jpg';
|
* this.picture = 'assets/img/test.jpg';
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
|
* // take a snap shot
|
||||||
|
* this.cameraPreview.takeSnapshot(this.pictureOpts).then((imageData) => {
|
||||||
|
* this.picture = 'data:image/jpeg;base64,' + imageData;
|
||||||
|
* }, (err) => {
|
||||||
|
* console.log(err);
|
||||||
|
* this.picture = 'assets/img/test.jpg';
|
||||||
|
* });
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* // Switch camera
|
* // Switch camera
|
||||||
* this.cameraPreview.switchCamera();
|
* this.cameraPreview.switchCamera();
|
||||||
@ -245,6 +253,20 @@ export class CameraPreview extends IonicNativePlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Take a snapshot of preview window (size specified in startCamera options)
|
||||||
|
* @param {CameraPreviewPictureOptions} [options] quality of the picture to take
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
successIndex: 1,
|
||||||
|
errorIndex: 2
|
||||||
|
})
|
||||||
|
takeSnapshot(options?: CameraPreviewPictureOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Set camera color effect.
|
* Set camera color effect.
|
||||||
|
Loading…
Reference in New Issue
Block a user