當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ImagePicker.getPictures方法代碼示例

本文整理匯總了TypeScript中ionic-native.ImagePicker.getPictures方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ImagePicker.getPictures方法的具體用法?TypeScript ImagePicker.getPictures怎麽用?TypeScript ImagePicker.getPictures使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ionic-native.ImagePicker的用法示例。


在下文中一共展示了ImagePicker.getPictures方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: constructor

  constructor(public nav: NavController) {
    this.options = {
      // max images to be selected, defaults to 15. If this is set to 1, upon
      // selection of a single image, the plugin will return it.
      maximumImagesCount: 15,

      // max width and height to allow the images to be.  Will keep aspect
      // ratio no matter what.  So if both are 800, the returned image
      // will be at most 800 pixels wide and 800 pixels tall.  If the width is
      // 800 and height 0 the image will be 800 pixels wide if the source
      // is at least that wide.
      width: 1024,
      height: 1024,

      // quality of resized image, defaults to 100
      quality: 100
    };
    ImagePicker.getPictures(this.options).then((results) => {
      this.images=results;
      for (var i = 0; i < results.length; i++) {
        console.log('Image URI: ' + results[i]);
      }
    }, (err) => {
    });
  }
開發者ID:thgautier92,項目名稱:ionicV2,代碼行數:25,代碼來源:image-picker.ts

示例2: uploadImage

 //用戶上傳頭像
 uploadImage(){
   var opt = { maxImagesCount:1, width:100, height:100, quality:50 };
   ImagePicker.getPictures(opt).then((results) => {
     for (var i = 0; i < results.length; i++) {
       //console.log('Image URI: ' + results[i]);
       console.log('Image URI: ' + results[i]);
       //將圖片上傳到服務器,調用 API
     }
   }, (err) => { }) ;
 }
開發者ID:chinazzlm,項目名稱:ionic2-case-app,代碼行數:11,代碼來源:myhome.ts

示例3: doImagePicker

  doImagePicker(){
    var options:ImagePickerOptions = {

    }
    ImagePicker.getPictures(options).then((results) => {
      for (var i = 0; i < results.length; i++) {
        console.log('Image URI: ' + results[i]);
      }
    }, (err) => {
      console.log(err);
    });
  }
開發者ID:javalv,項目名稱:ts-app,代碼行數:12,代碼來源:details.ts

示例4: getImages

    getImages() {
        let options = {
            width: 100,
            height: 100,
            quality: 100
        };
        ImagePicker.getPictures(options).then(results => {
            this.images = results;
        }, (err) => {

        });
    }
開發者ID:ralphowino,項目名稱:ionic-native-kitchen-sink,代碼行數:12,代碼來源:imagepicker.ts

示例5: openGallery

  private openGallery (): void {
    let options = {
      maximumImagesCount: 8,
      width: 500,
      height: 500,
      quality: 75
    }

    ImagePicker.getPictures(options).then(
      file_uris => this._navCtrl.push(GalleryPage, {images: file_uris}),
      err => console.log('uh oh')
    );
	}
開發者ID:amuramoto,項目名稱:ionic-imagepicker-sample,代碼行數:13,代碼來源:home.ts

示例6: imagePicker

 imagePicker() {
     var options = {
        maximumImagesCount: 10,
        width: 800,
        height: 800,
        quality: 80
       };
     ImagePicker.getPictures(options).then((results) => {
       for (var i = 0; i < results.length; i++) {
           console.log('Image URI: ' + results[i]);
       }
     }, (err) => {
     });
 }
開發者ID:khavq,項目名稱:ion2-bangbang,代碼行數:14,代碼來源:photo.ts


注:本文中的ionic-native.ImagePicker.getPictures方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。