本文整理汇总了TypeScript中ionic-native.ImagePicker类的典型用法代码示例。如果您正苦于以下问题:TypeScript ImagePicker类的具体用法?TypeScript ImagePicker怎么用?TypeScript ImagePicker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ImagePicker类的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类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论