本文介绍了PhoneGap的 - 选择图片从图库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我,或点我在如何从手机的图片库的图像中的PhoneGap / Android的方向?有文档的访问摄像头(这伟大工程),但不选择现有的图像。

Can anyone tell me, or point me in the direction of how to get an image from the phone's image gallery in Phonegap / Android? There's docs on accessing the camera (which works great) but not selecting an existing image.

我在寻找的PhoneGap / Javascript的,而不是Java的。

I'm looking for Phonegap / Javascript rather than Java.

在此先感谢!

推荐答案

嗯,在摄像机文档中介绍。难道这不是为你工作?看看 Camera.PictureSourceType 的详细信息。该文档网站吉文斯本例中为由此得出的图像:

Erm, the Camera docs cover this. Is this not working for you? Check out Camera.PictureSourceType for details. The docs site givens this example for deriving an image thus:

function getPhoto(source) {
  // Retrieve image file location from specified source
  navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50,
    destinationType: destinationType.FILE_URI,
    sourceType: source });
}

sourceType的是决定性位在这里。它可以是 Camera.PictureSourceType.CAMERA (默认值),或更多对您有用它可以是 Camera.PictureSourceType.PHOTOLIBRARY Camera.PictureSourceType.SAVEDPHOTOALBUM

sourceType is the crucial bit here. It can be Camera.PictureSourceType.CAMERA (the default), or more useful for you it can be Camera.PictureSourceType.PHOTOLIBRARY or Camera.PictureSourceType.SAVEDPHOTOALBUM.

相机文档

这篇关于PhoneGap的 - 选择图片从图库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-28 02:35