问题描述
谁能告诉我,或点我在如何从手机的图片库的图像中的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的 - 选择图片从图库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!