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

TypeScript ionic-native.Camera类代码示例

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

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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