|
- Model.prototype.button1Click = function(event){
- document.addEventListener("deviceready", androidOnDeviceReady, false);
- function androidOnDeviceReady() {
- /*
- 调用getPictures有三个参数,成功回调,失败回调和options。option参数仅限于android端使用。
- options有以下几个下参数(maximumImagesCount,width,height,quality,outputType),说明如下
- options = {
- 图片选择数量默认为15张,如果设置为1张,点选一张图片后即可返回该图片路径。
- 最大图片选择数量,规定了每次最多选择几张图片。
- maximumImagesCount: int,
-
- 图片的高度和宽度限定,举例说明:如果宽高都设定为800,图片最大为800像素*800像素,如果宽度为800,高度为0,则图片则会有800像素宽。
- 如果都写成0,则按照图片大小显示
- width: int,
- height: int,
-
- 图片质量,取值为0-100
- quality: int (0-100),
-
- 导出图片的类型,默认为window.imagePicker.OutputType.FILE_URI(实际值为0),可选window.imagePicker.OutputType.BASE64_STRING (实际值为1)
- outputType: int
- };
- */
- imagePicker.getPictures(androidSuccessCallback, errorCallback,
- {
- "maximumImagesCount":10,
- "width":800,
- "height":800,
- "quallity":100,
- <font color="#ff0000"> "outputType":window.imagePicker.OutputType.BASE64_STRING</font>
- }
- );
- }
- function androidSuccessCallback(result) {
- if (result.length > 0) {
- alert("11111");
- } else {
- // picker was cancelled
- alert("2222");
- }
-
- }
复制代码
outputType window.imagePicker.OutputType.FILE_URI就可以 alert("11111"); 为window.imagePicker.OutputType.BASE64_STRING 一个alert也不出来。为什么啊???想得到图片的base64编码,得不到吗? |
|