• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript camera.Camera类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getImage

 getImage() {
   const options: CameraOptions = {
     quality: 100,
     destinationType: this.camera.DestinationType.FILE_URI,
     sourceType: this.camera.PictureSourceType.PHOTOLIBRARY
   }
 
   this.camera.getPicture(options).then((imageData) => {
     this.imageURI = imageData;
   }, (err) => {
     console.log(err);
     this.presentToast(err);
   });
 }
开发者ID:tinchoas19,项目名称:app-upload-camera,代码行数:14,代码来源:home.ts


示例2: takePhoto

  takePhoto(){
    const options: CameraOptions = {
      quality: 100,
      destinationType: this.camera.DestinationType.DATA_URL,
      encodingType: this.camera.EncodingType.JPEG,
      mediaType: this.camera.MediaType.PICTURE
    };

    this.camera.getPicture(options).then((imageData) => {
      this.photo = 'data:image/jpeg;base64,' + imageData;
      return this.photo;
    }, (err) => {
      this.showErrorMessage();
    });
  };
开发者ID:50Hannah000,项目名称:MDB1,代码行数:15,代码来源:camera.ts


示例3: takePhoto

  takePhoto(){
    const options: CameraOptions = {
      quality: 100,
      destinationType: this.camera.DestinationType.DATA_URL,
      encodingType: this.camera.EncodingType.JPEG,
      mediaType: this.camera.MediaType.PICTURE
    };

    this.camera.getPicture(options).then((imageData) => {
      // imageData is either a base64 encoded string or a file URI
      // If it's base64:
      this.base64Image = 'data:image/jpeg;base64,' + imageData;
     }, (err) => {
      this.showErrorMessage();
         });
    };
开发者ID:50Hannah000,项目名称:MDB1,代码行数:16,代码来源:picture.ts


示例4: chamarCamera

  chamarCamera(){
    debugger
    const options: CameraOptions = {
      quality: 100,
      destinationType: this.camera.DestinationType.FILE_URI,
      encodingType: this.camera.EncodingType.JPEG,
      mediaType: this.camera.MediaType.PICTURE
    }
    this.camera.getPicture(options).then((imageData) => {
      // imageData is either a base64 encoded string or a file URI
      // If it's base64 (DATA_URL):
      let base64Image = 'data:image/jpeg;base64,' + imageData;
     }, (err) => {
      // Handle error
     });
    

  }
开发者ID:flaviacriss,项目名称:Verdejarapp,代码行数:18,代码来源:newtree.ts


示例5: takePicture

  takePicture(){
    this.camera.getPicture({
      destinationType: this.camera.DestinationType.DATA_URL,

      targetWidth: 1000,
      targetHeight: 1000
    }).then((ImageData) =>{
      this.base64Image = "data:image/jpeg;base64," + ImageData;
    }, (err) => {
      console.log(err);
    });
  }
开发者ID:Jeffsummers2412,项目名称:camera,代码行数:12,代码来源:camera.ts


示例6: takePhoto

  async takePhoto() {
    try {
      const imageData = await this.camera.getPicture({
        quality: 100,
        destinationType: this.camera.DestinationType.FILE_URI,
        sourceType: this.camera.PictureSourceType.CAMERA,
        encodingType: this.camera.EncodingType.PNG
      });

      await this.uploadPhoto(imageData);
    }
    catch (e) {
      console.log(e);
    }
  }
开发者ID:ralscha,项目名称:attic,代码行数:15,代码来源:home.ts


示例7:

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;
        this.base64NoGarbase = imageData;
        this.uploadImage();
        //console.dir("base 64 image: "+this.base64NoGarbase);
    }, (err) => {
        console.log(err);
    });
  }
开发者ID:jessiejane,项目名称:SimpleLiving,代码行数:15,代码来源:billsplitter.ts


示例8: selectPhoto

  async selectPhoto() {
    try {
      const imageData = await
        this.camera.getPicture({
          sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
          destinationType: this.camera.DestinationType.FILE_URI,
          quality: 100,
          encodingType: this.camera.EncodingType.PNG,
        });

      await this.uploadPhoto(imageData);
    }
    catch (e) {
      console.log(e);
    }
  }
开发者ID:ralscha,项目名称:attic,代码行数:16,代码来源:home.ts


示例9: resolve

 return new Promise<Array<string>>((resolve, reject) => {
   let options: any =
 	{
 		quality: 100,
 		correctOrientation: true,
     destinationType: 1,
 	};
 	this.cameraService.getPicture(options).then((data: string) => {
     this.saveImages(new Array<string>(data), true, this.fileService.getAppStoragePath()).then((resultPhotos: Array<string>) =>{
       resolve(resultPhotos);
     }).catch(error => {
       console.log('Error during photo reduce: ' + error.message);
     });
 	}, error =>	{
     console.log('Error during taking photo: ' + error.message);
     resolve(new Array<string>());
   });
 });
开发者ID:exodinn,项目名称:StarterKit,代码行数:18,代码来源:image-service.ts


示例10: takePicture

  takePicture(){
    let options = {
      quality: 100,
      correctOrientation: true
    };

    this.camera.getPicture(options)
    .then((data) => {
      this.photos = new Array<string>();
      this.cropService
      .crop(data, {quality: 75})
      .then((newImage) => {
        this.photos.push(newImage);
      }, error => console.error("Error cropping image", error));
    }, function(error) {
      console.log(error);
    });
  }
开发者ID:zglnfsdyy,项目名称:ionic3-image-handling,代码行数:18,代码来源:home.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript clipboard.Clipboard类代码示例发布时间:2022-05-28
下一篇:
TypeScript calendar.Calendar类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap