Using Cordova/Phonegap to save an image taken from

2019-09-03 14:50发布

问题:

I am using Visual Studio 2010 and the Windows Phone 7 Emulator in order to create an app which allows the user to take a photo and then save it into a folder on the file system and also create a reference of it on the database so as all of the images on the database can be displayed on the app. I can't however save the Image that is taken by the camera, I have spent ages looking through the Cordova docs and other websites. It looks as if I need the file location of the image taken by the camera but I cannot get the consol.log to open, I have been through my Registry Editor and I cannot get it to display. I would love an example which would show me how to get the camera image and either save it to localstorage or create a copy in order to save it into a folder. Thanks in advance

回答1:

Use FILE_URI for Camera.DestinationType option. It will make the image captured stored in the device's image gallery.

Reference: http://docs.phonegap.com/en/2.6.0/cordova_camera_camera.md.html#cameraOptions