当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ionic-native.Camera类代码示例

本文整理汇总了TypeScript中ionic-native.Camera的典型用法代码示例。如果您正苦于以下问题:TypeScript Camera类的具体用法?TypeScript Camera怎么用?TypeScript Camera使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Camera类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: takePicture

 takePicture(){
   Camera.getPicture({
       destinationType: 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);
   });
 }
开发者ID:geraldasd,项目名称:SGSL-21-JULY,代码行数:12,代码来源:camera.ts

示例2: takePhoto

  takePhoto(){
    Camera.getPicture({
      quality: 100,
      cameraDirection: Camera.Direction.FRONT,
      destinationType: Camera.DestinationType.DATA_URL
    }).then((imageData) => {
      let base64Image = 'data:image/jpeg;base64,' + imageData;
      this.image = base64Image;
    }, (err) => {

    });
  }
开发者ID:arthurbragaa,项目名称:ionic2-native,代码行数:12,代码来源:camera-test.ts

示例3: openCamera

 openCamera() {
   var options = {
     sourceType: Camera.PictureSourceType.CAMERA,
     destinationType: Camera.DestinationType.DATA_URL
   };
   Camera.getPicture(options).then((imageData) => {
     this.cameraData = 'data:image/jpeg;base64,' + imageData;
     this.photoTaken = true;
     this.photoSelected = false;
   }, (err) => {
     // Handle error
   });
 }
开发者ID:ivanthecrazy,项目名称:devfanaticblog-camera-upload,代码行数:13,代码来源:home.ts

示例4: takePicture

  takePicture(){
    let options = {
      destinationType: Camera.DestinationType.DATA_URL,
      targetWidth: 1000,
      targetHeight: 1000,
      quality: 100
    }

    Camera.getPicture( options )
    .then(imageData =>{
      this.image = 'data:image/jpeg;base64,' + imageData;
    });
  }
开发者ID:EscuelaIt,项目名称:class8-ionic-2,代码行数:13,代码来源:home.ts

示例5: selectFromGallery

 selectFromGallery() {
   var options = {
     sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
     destinationType: Camera.DestinationType.FILE_URI
   };
   Camera.getPicture(options).then((imageData) => {
     this.cameraUrl = imageData;
     this.photoSelected = true;
     this.photoTaken = false;
   }, (err) => {
     // Handle error
   });
 }
开发者ID:ivanthecrazy,项目名称:devfanaticblog-camera-upload,代码行数:13,代码来源:home.ts

示例6: takePicture

 takePicture(){
   Camera.getPicture({
       destinationType: Camera.DestinationType.DATA_URL,
       targetWidth: 1024,
       targetHeight: 768,
       correctOrientation: false,
       quality: 80
   }).then((imageData) => {
     // imageData is a base64 encoded string
       this.base64Image = "data:image/jpeg;base64," + imageData;
   }, (err) => {
       console.log(err);
   });
 }
开发者ID:RemaxThailand,项目名称:RemaxMobile,代码行数:14,代码来源:payments-confirm.ts

示例7: getPicture

 getPicture(sourceType){
   let options = {
     destinationType: Camera.DestinationType.DATA_URL,
     targetWidth: 1000,
     targetHeight: 1000,
     quality: 100,
     correctOrientation: true,
     saveToPhotoAlbum: false,
     sourceType: (sourceType == 'picture') ? Camera.PictureSourceType.PHOTOLIBRARY : Camera.PictureSourceType.CAMERA
   }
   Camera.getPicture(options).then((imageData) => {
     this.image = "data:image/jpeg;base64," + imageData;
   }, (err) => {
   });
 }
开发者ID:jorgerrubio,项目名称:ionic-v2-native,代码行数:15,代码来源:camara.ts

示例8: takePicture

 takePicture() {
    Camera.getPicture({
       destinationType: Camera.DestinationType.FILE_URI,
       targetWidth: 1000,
       targetHeight: 1000,
       correctOrientation: true
     }).then((imageURI) => {
     // imageData is a base64 encoded string
       console.log(imageURI);
       this.image.src =  imageURI;
       // this.base64Image = "data:image/jpeg;base64," + imageURI;
     }, (err) => {
       console.log(err);
     });
 }
开发者ID:a-santamaria,项目名称:cropIonic,代码行数:15,代码来源:home-page.ts

示例9: getPicture

 getPicture (sourceType: number) {
   // You can check the values here:
   // https://github.com/driftyco/ionic-native/blob/master/src/plugins/camera.ts
   Camera.getPicture({
     quality: 100,
     destinationType: 0, // DATA_URL
     sourceType: sourceType,
     allowEdit: true,
     saveToPhotoAlbum: false,
     correctOrientation: true
   }).then(imageData => {
     this.srcImage = `data:image/jpeg;base64,${imageData}`;
   }, error => {
       console.log(`ERROR -> ${JSON.stringify(error)}`);
   });
 }
开发者ID:Dakuan,项目名称:ionic-ocr-example,代码行数:16,代码来源:home.ts

示例10: takePicture

 //add action take a picture
 takePicture() {
   Camera.getPicture({
     destinationType: Camera.DestinationType.DATA_URL
   })
     .then((image) => {
       //image is a base64 encoded string
       this.base64Image = "data:image/jpeg;base64," + image;
     }, (error) => {
       //display alert if error
       let alert = Alert.create({
         title: 'Ups. Error occurs!',
         subTitle: 'Sorry, we have a error. Please try later or fix the bug.',
         buttons: ['OK']
       });
       this.nav.present(alert);
     });
 }
开发者ID:ol3j,项目名称:myapp,代码行数:18,代码来源:camera.ts


注:本文中的ionic-native.Camera类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。