这个是用于从设备读取图片缩略图和原始图片。
具体使用方法下载该项目并解压,然后在你的工程目录执行
cordova plugin add [path of plugin]
##E.X. #获取缩略图: Photos.getThumbPhotos(function(arguments){ var objs = JSON.parse(arguments); 。。。。。。 }.bind(this),function(arguments){ 。。。。。。 },[index,max,width,height]); // index default:0,max default:20,width default:30,height default:30
Data format: [{url:pic_id,data:...},...]
#获取原图: Photos.getRealPhoto(function(arguments){ var objs = JSON.parse(arguments); 。。。。。。 },function(arguments){ 。。。。。。 },[param.url]); {data:......}
#同时获取多个原图(慎用): ##这是一个脑子犯二的时候写的一个api,如果终端足够强悍的话,当然可以尝试一下 ##但是如果你的手机无法承受同时读取多图的话,还是算了吧会蹦的 var urlArray = []; urlArray.push(url); Photos.getMultiRealPhotos(function(arguments){ var objs = JSON.parse(arguments); 。。。。。。 },function(arguments){ 。。。。。。 },[urlArray]); [{url:pic_id,data:...},...]
目前仅支持ios,android版本会陆续更新。
#------------------Update history------------------ 2016-01-11 : Add default value for api Photos.getThumbPhotos[index,max,width,height] 2016-01-11 :Support for get multi photos by new api getMultiRealPhotos[urlArray] I do not advise you invoking this api to get photos, Or you get memory Warning! ^_^
#----------------------Author---------------------- email :[email protected] qq :46517115 wechat:lianghui086343 URL : https://github.com/ryouaki/Cordova-Plugin-Photos