on 02-02-2012 2:04 AM
hello all,
I'm trying to implement the camera but I did not hit my code is as follows:
var options;
getPicture (onLRPM1, onLRPM2, options);
I'm getting the error "-4", which according to documentation () Means "/ ** Supplied Were Not Recognized options. * / PictureError.BAD_OPTIONS = -4;
".
According to the documentation the options parameter should be:
"options - picture options:
PictureOptions.CAMERA - the picture is stored in the camera application folder
PictureOptions.PHOTOLIBRARY - a photo chooser dialog is native Shown, from Which a photo from a file Can be selected (JPEG only). "
But as I do in javascript?, Someone has already used the API?
regards
Hi,
Without seeing what you have defined as onLRPM1, onLRPM2 and options, this is difficult to say.
The first parameter to the getPicture function is expecting a function to call if this function fails. The second parameter is expecting a function to call when this call succeeds. The third parameter is used to specify whether to get the picture from the device's camera, or photo library.
Here is a simple example using the device's camera. Change PictureOption.CAMERA to PictureOption.PHOTOLIBRARY if you wish to select a photo from the device's photo library instead.
// A function invoked by a manual button press
function getCameraPicture()
{
getPicture(function(err) { logToWorkflow("Camera error=" + err); },
function(data) { logToWorkflow("Camera success len=" + data.length); },
PictureOption.CAMERA);
};
You should replace the logToWorkflow call with something you wish to do with the returned data.
Hope this helps,
Andrew.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.