Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component } from "@angular/core";
- import { Camera, CameraOptions } from "@ionic-native/camera";
- @Component({
- selector: "page-camera",
- templateUrl: "camera.html"
- })
- export class CameraPage {
- public base64Image: string;
- constructor(public camera: Camera) {}
- takePicture() {
- this.camera
- .getPicture({
- destinationType: this.camera.DestinationType.DATA_URL,
- targetWidth: 1000,
- targetHeight: 1000
- })
- .then(
- imageData => {
- // imageData is a base64 encoded string
- this.base64Image = "data:image/jpeg;base64," + imageData;
- },
- err => {
- console.log(err);
- }
- );
- }
- }
- 2018-12-13 11:31:24.183490-0500 MyApp[3844:312133] ERROR: Plugin 'Camera' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
- 2018-12-13 11:31:24.183546-0500 MyApp[3844:312133] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = ["Camera1764610053","Camera","takePicture",[50,0,1,1000,1000,0,0,false,false,false,null,0]]
Add Comment
Please, Sign In to add comment