mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
parent
c75f89894a
commit
58c9439a32
@ -21,6 +21,52 @@ export interface CameraPreviewSize {
|
||||
*
|
||||
* For more info, please see the [Cordova Camera Preview Plugin Docs](https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview).
|
||||
*
|
||||
* @usage
|
||||
* ```
|
||||
* import { CameraPreview } from 'ionic-native';
|
||||
*
|
||||
* // camera options (Size and location)
|
||||
* let cameraRect: CameraPreviewRect = {
|
||||
* x: 100,
|
||||
* y: 100,
|
||||
* width: 200,
|
||||
* height: 200
|
||||
* };
|
||||
*
|
||||
*
|
||||
* // start camera
|
||||
* CameraPreview.startCamera(
|
||||
* cameraRect, // position and size of preview
|
||||
* 'front', // default camera
|
||||
* true, // tape to take picture
|
||||
* false, // disable drag
|
||||
* true // send the preview to the back of the screen so we can add overlaying elements
|
||||
* );
|
||||
*
|
||||
* // Set the handler to run every time we take a picture
|
||||
* CameraPreview.setOnPictureTakenHandler().subscribe((result) => {
|
||||
* console.log(result);
|
||||
* // do something with the result
|
||||
* });
|
||||
*
|
||||
*
|
||||
* // take a picture
|
||||
* CameraPreview.takePicture({
|
||||
* maxWidth: 640,
|
||||
* maxHeight: 640
|
||||
* });
|
||||
*
|
||||
* // Switch camera
|
||||
* CameraPreview.switchCamera();
|
||||
*
|
||||
* // set color effect to negative
|
||||
* CameraPreview.setColorEffect('negative');
|
||||
*
|
||||
* // Stop the camera preview
|
||||
* CameraPreview.stopCamera();
|
||||
*
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
plugin: 'cordova-plugin-camera-preview',
|
||||
@ -42,9 +88,7 @@ export class CameraPreview {
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static startCamera(rect: CameraPreviewRect, defaultCamera: string, tapEnabled: boolean, dragEnabled: boolean, toBack: boolean, alpha: number): void {
|
||||
|
||||
};
|
||||
static startCamera(rect: CameraPreviewRect, defaultCamera: string, tapEnabled: boolean, dragEnabled: boolean, toBack: boolean, alpha: number): void { };
|
||||
|
||||
/**
|
||||
* Stops the camera preview instance.
|
||||
|
Loading…
Reference in New Issue
Block a user