Class: FixedAspectRatioCaptureExperience

FixedAspectRatioCaptureExperience()

new FixedAspectRatioCaptureExperience()

This FixedAspectRatioCaptureExperience class is responsible for handling the corresponding plugin js to interact with the native FixedAspectRatioCaptureExperience class. To set and get the properties, and to access the instance methods, corresponding JS methods are written under this class which are used by the end user in application script.

Methods

addImageAboutToCaptureListener(successCallback, errorCallback, imageAboutToCaptureCallback)

A listener that will be called when an image is about to capture. This will only be sent after the experience receives a takePicture message. The experience will wait until the desired stability, levelness, and camera adjustments are met and then capture an image. Add this event listener before calling the 'takePicture' method.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error Call back function name
imageAboutToCaptureCallback function Call back for event
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. By Default, the error call back would return a JSON object giving ErrMsg & ErrDesc giving the description of the error.
Returns:
The return value is captured in the 'successCallback' function for successful operation. The 'imageAboutToCaptureCallback' will have return value in this callback
Example
function imageAboutToCaptureCallback(response)
{
      alert(JSON.stringify(response));
}
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var fixedAspectRatioCaptureExperience = kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
fixedAspectRatioCaptureExperience.addImageAboutToCaptureListener(successCallback, errorCallback, imageAboutToCaptureCallback);

addImageCapturedListener(successCallback, errorCallback, imageCaptureCallback)

A listener that will be called when an image was captured. This will only be sent after the experience receives a takePicture message. The experience will wait until the desired stability, levelness, and camera adjustments are met and then capture an image. It would then send the imageObject of the captured image to success call back method. Add this event listener before calling the 'takePicture' method.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error Call back function name
imageCaptureCallback function A JSON object containing the properties of the captured image object. Check the 'Image' object for its properties.
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. By Default, the error call back would return a JSON object giving ErrMsg & ErrDesc giving the description of the error.
Returns:
The return value is captured in the 'successCallback' function and will have a zero(0) for successful operation. The 'imageCaptureCallback' will have the JSON object of the captured KfxKEDImage properties. The captured KEDImage is stored in ImageArray. The image can be retrieved using methods on ImageArray.
Example
function imageCaptureCallback(imageObject)
{
      alert(JSON.stringify(imageObject));
}
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var fixedAspectRatioCaptureExperience = kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
fixedAspectRatioCaptureExperience.addImageCapturedListener(successCallback, errorCallback, imageCaptureCallback);

addImageJustCapturedListener(successCallback, errorCallback, imageJustCapturedCallback)

A listener that will be called when an image is captured and just before done message is shown. This will only be sent after the experience receives a takePicture message. The experience will wait until the desired stability, levelness, and camera adjustments are met and then capture an image. It would then send the imageObject of the captured image to success call back method. Add this event listener before calling the 'takePicture' method.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error Call back function name
imageJustCapturedCallback function A JSON object containing the properties of the captured image object. Check the 'Image' object for its properties.
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. By Default, the error call back would return a JSON object giving ErrMsg & ErrDesc giving the description of the error.
Returns:
The return value is captured in the 'successCallback' function for successful operation. The 'imageJustCapturedCallback' will have the JSON object of the captured KfxKEDImage properties. The captured KEDImage is stored in ImageArray. The image can be retrieved using methods on ImageArray.
Example
function imageJustCapturedCallback(imageObject)
{
      alert(JSON.stringify(imageObject));
}
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var fixedAspectRatioCaptureExperience = kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
fixedAspectRatioCaptureExperience.addImageJustCapturedListener(successCallback, errorCallback, imageJustCapturedCallback);

bindCaptureControl(successCallback, errorCallback, imageCaptureControlID)

Method to bind the created ImageCapture Control with the FixedAspectRatioCaptureExperience class .
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
imageCaptureControlID String Pass the ID retrieved for the Image Capture Control. If a wrong ID is passed an error is received in the error callback
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCB : KMC_SUCCESS success call back. errorCB : error message would contain the appropriate error description.Possible error objects are Invalid Capture Control ID, KmcRuntimeException & Exception.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var imageCaptureControlID = null;
var fixedAspectRatioCaptureExperience =  kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});

fixedAspectRatioCaptureExperience.bindCaptureControl(successCallback,errorCallback,imageCaptureControlID);

bindCaptureControlWithOptions(successCallback, errorCallback, options)

Method to bind the created ImageCapture Control with the FixedAspectRatioCaptureExperience class and also to set options. This method is a combination of bindCaptureControl API and setOptions API.
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
options Object : A JSON object containing the ID retrieved for the Image Capture Control and the properties to be set to the FixedAspectRatioCaptureExperience. If a wrong ID is passed an error is received in the error callback
Properties
Name Type Attributes Description
ImageCaptureControlID String <optional>
: Pass the ID retrieved for the Image Capture Control. If a wrong ID is passed an error is received in the error callback.
CaptureExperienceOptions Object <optional>
: a 'fixedAspectRatioCaptureExperienceOptions' variable containing the properties to be set to the FixedAspectRatioCaptureExperience.
See:
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCB : KMC_SUCCESS success call back. errorCB : error message would contain the appropriate error description.Possible error objects are Invalid Capture Control ID, KmcRuntimeException & Exception.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var imageCaptureControlID = null;
var fixedAspectRatioCaptureExperienceOptions = null;
var fixedAspectRatioCaptureExperience =  kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
fixedAspectRatioCaptureExperience.getOptions(function(success){fixedAspectRatioCaptureExperienceOptions = success},function(error){alert(JSON.stringify(error));});
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});

fixedAspectRatioCaptureExperience.bindCaptureControlWithOptions(successCallback,errorCallback,{"ImageCaptureControlID":imageCaptureControlId,"CaptureExperienceOptions":fixedAspectRatioCaptureExperienceOptions});

destroy(successCallback, errorCallback)

Method to clear FixedAspectRatioCaptureExperience memory.
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - success string indicating the method has been invoked errorCallback - error in case any error occurs
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var imageCaptureControlID = null;
var fixedAspectRatioCaptureExperience =  kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});

fixedAspectRatioCaptureExperience.bindCaptureControl(successCallback,errorCallback,imageCaptureControlID);
fixedAspectRatioCaptureExperience.takePictureContinually(successCallback,errorCallback);
fixedAspectRatioCaptureExperience.destroy(successCallback,errorCallback);

getFixedAspectRatioCaptureOptions()

Method returning the 'FixedASpectRatioCaptureExperience' class properties that can be set by the user. Use this object as an input parameter to set the properties of the FixedAspectRatioCaptureExperience class. The parameters are grouped, and has the below mentioned default values.
Example
var fixedAspectRatioCaptureExperience =  kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
var fixedAspectRatioCaptureOptions = fixedAspectRatioCaptureExperience.getFixedAspectRatioCaptureOptions();
fixedAspectRatioCaptureOptions should be like below {
   LookAndFeel: {
        enableAnimationTutor: false,
        outerViewFinderColor : "#B2000000",
        vibrationEnabled : true,
        diagnosticsViewEnabled : false,
        guidanceFrameThickness : 8,
        tutorialSampleImagePath : '',
        guidanceFrameColor : "#00FF00",
        guidanceFrameThickness: 8 
   },
   CaptureCriteria: {
        stabilityThresholdEnabled: true,
        stabilityThreshold: 95,
        focusEnabled: true,
        rollThresholdEnabled: false,
        rollThreshold: 15,
        pitchThreshold: 15,
        pitchThresholdEnabled: false,
        refoucsBeforeCaptureEnabled: true,
        holdSteadyDelay: 1.0,
         pageDetectionEnabled: true,
        FarDetectionSettings:{
           DetectionSettings:{
              centerPoint:{
                 x: null,
                 y: null
              },
              aspectRatio: 0.6296296296,
              padding: 8.0
           }
        }
   },
   UserInstructionMessage: {
        backgroundColor: "#00000000",
        textColor: "#FFFFFFFF",
        message: "Fill viewable area with document",
        visible: true,
        orientation: "PORTRAIT",
        fontAndroid: {
          textSize : -1
        },
        fontiOS:{
          fontSize : -1,
          fontName : "HelveticaNeue"
        },
        position :{
           x : -1,
           y : -1
        },
        size:{
           width: -1,
           height: -1
        }
   },
   HoldSteadyMessage: {
        backgroundColor: "#B2000000",
        textColor: "#FFFF0000",
        message: "Hold Steady",
        visible: true,
       orientation: "PORTRAIT",
        fontAndroid: {
          textSize : -1
        },
        fontiOS:{
          fontSize : -1,
          fontName : "HelveticaNeue"
        },
        position :{
           x : -1,
           y : -1
        },
        size:{
           width: -1,
           height: -1
        }
   },
   CapturedMessage: {
        backgroundColor: "#B2000000",
        textColor: "#00F900",
        message: "Done!",
        visible: true,
        orientation: "PORTRAIT",
        fontAndroid: {
          textSize : -1
        },
        fontiOS:{
          fontSize : -1,
          fontName : "HelveticaNeue"
        },
        position :{
           x : -1,
           y : -1
        },
        size:{
           width: -1,
           height: -1
        }
   },
   HoldParallelMessage: {
           backgroundColor: "#B2000000",
           textColor: "#FFFFFFFF",
           message: "Hold Device Level",
           visible: true,
               orientation: "PORTRAIT",
           fontAndroid: {
             textSize : -1
          },
          fontiOS:{
             fontSize : -1,
             fontName : "HelveticaNeue"
           },
           position :{
              x : -1,
              y : -1
           },
           size:{
              width: -1,
              height: -1
           }
  },
TutorialDismissMessage: {
  backgroundColor: "#B2000000",
  textColor: "#FFFFFFFF",
  message: "Tap to dismiss",
       visible: true,
  orientation: "PORTRAIT",
  fontAndroid: {
    textSize : -1
 },
 fontiOS:{
    fontSize : -1,
    fontName : "HelveticaNeue"
  },
  position :{
     x : -1,
     y : -1
  },
  size:{
     width: -1,
    height: -1
  }
}
};

getOptions(successCallback, errorCallback)

Method to get the properties of the native FixedAspectRatioCaptureExperience class.
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
See:
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback : JSONObject representing FixedAspectRatioCaptureExperience Options. JSONObject structure can also be known from getFixedAspectRatioCaptureOptions() method. errorCallback : error message would contain the appropriate error description.Possible error objects are KmcRuntimeException,JSONException & Exception.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var imageCaptureControlID = null;
var fixedAspectRatioCaptureExperience =  kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});

fixedAspectRatioCaptureExperience.bindCaptureControl(successCallback,errorCallback,imageCaptureControlID);
fixedAspectRatioCaptureExperience.getOptions(successCallback,errorCallback);

removeImageAboutToCaptureListener(successCallback, errorCallback)

The method would remove the listener to the delegate call back of the takePicture method.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error Call back function name
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. Generally the error call back would return a JSON object with 'ErrorMs' & 'ErrorDesc' giving the description of the error.
Returns:
The return value is captured in the 'successCallback' function for successful operation.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var fixedAspectRatioCaptureExperience = kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
// after taking picture
fixedAspectRatioCaptureExperience.removeImageAboutToCaptureListener(successCallback,errorCallback);

removeImageCapturedListener(successCallback, errorCallback)

The method would remove the listener to the delegate call back of the takePicture method.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error Call back function name
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. Generally the error call back would return a JSON object with 'ErrorMs' & 'ErrorDesc' giving the description of the error.
Returns:
The return value is captured in the 'successCallback' function and will have a zero(0) for successful operation.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var fixedAspectRatioCaptureExperience = kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
// after taking picture
fixedAspectRatioCaptureExperience.removeImageCapturedListener(successCallback,errorCallback);

removeImageJustCapturedListener(successCallback, errorCallback)

The method would remove the listener to the delegate call back of the takePicture method.
Parameters:
Name Type Description
successCallback function Default Success Call back function name
errorCallback function Default Error Call back function name
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. Generally the error call back would return a JSON object with 'ErrorMs' & 'ErrorDesc' giving the description of the error.
Returns:
The return value is captured in the 'successCallback' function and will have a zero(0) for successful operation.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var fixedAspectRatioCaptureExperience = kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
// after taking picture
fixedAspectRatioCaptureExperience.removeImageJustCapturedListener(successCallback,errorCallback);

setOptions(successCallback, errorCallback, parameters)

Method to set the properties of the native FixedAspectRatioCaptureExperience class.
Parameters:
Name Type Attributes Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
parameters Object a 'fixedAspectRatioExperienceOptions' variable containing the properties to be set to the FixedAspectRatioCaptureExperience
options.LookAndFeel Object Look and Feel options
Properties
Name Type Attributes Default Description
outerViewFinderColor String <optional>
"#B2000000" This value specifies the outer view finder color
enableAnimationTutor Boolean <optional>
false This value specifies the animation tutor is enable or not. If user faces any difficulty while capturing a document then he need to enable the animation tutor.
vibrationEnabled Boolean <optional>
true This value specifies the device vibration is enable or not when image capture happens
diagnosticsViewEnabled Boolean <optional>
false This value specifies to turn ON/OFF diagnostic information view
guidanceFrameThickness Number <optional>
8 This value specifies the thickness that will be used for the guidance frame. Valid values are in the range [1, 100]. Values outside this range will be interpreted as 8. The default thickness is 8.
tutorialSampleImagePath String <optional>
"" This value specifies the tutorial image path to display custom tutorial image, this path should be relative to www root folder of the application. It is set only property and getOptions will always return this property with empty value. The images cannot be of very high resolution and size.The sample image is stretched if necessary to fill the entire frame area.
guidanceFrameColor Boolean <optional>
"#00FF00" This value specifies the color that will be used for the guidance frame.
guidanceFrameThickness Number <optional>
8 Specifies the thickness that will be used for the guidance frame.Valid values are in the range [1, 100]. Values outside this range will be interpreted as 8 for iOS and for Android , the default value is 12 if not set .
options.CaptureCriteria Object capture criteria options
Properties
Name Type Attributes Default Description
stabilityThresholdEnabled Boolean <optional>
true Whether the stability threshold is enabled. A boolean that indicates whether the stability threshold is enabled.If enabled this criteria is checked before taking a picture.
pitchThresholdEnabled Boolean <optional>
false Whether the Pitch threshold is enabled. A boolean that indicates whether the Pitch threshold is enabled. If enabled this criteria is checked before taking a picture.
rollThresholdEnabled Boolean <optional>
false Whether the Roll threshold is enabled. A boolean that indicates whether the Roll threshold is enabled. If enabled this criteria is checked before taking a picture.
focusEnabled Boolean <optional>
true Whether the Focus constraint is enabled. A boolean that indicates whether the Focus constraint is enabled. If enabled this criteria is checked before taking a picture. Making it enabled is advisable. Otherwise it is highly likely that images out of focus are captured. Default value is enabled.
stabilityThreshold Number <optional>
95 The stability threshold value Stability Value which needs to be met before taking a picture. It is a number from 0 to 100, where 100 indicates that the device must be near perfectly still to take a picture and 0 indicates that stability checking is turned off. Default value is 95
pitchThreshold Number <optional>
15 The Pitch threshold value Pitch Value which needs to be met before taking a picture. The default value is 15. Valid values are in the range [0, 45]. Values outside this range will be interpreted as 0 or 45. A value of 45 disables level checking for pitch.
rollThreshold Number <optional>
15 The Roll threshold value Roll Value which needs to be met before taking a picture. The default value is 15. Valid values are in the range [0, 45]. Values outside this range will be interpreted as 0 or 45. A value of 45 disables level checking for roll.
refoucsBeforeCaptureEnabled Boolean <optional>
true Value which indicates to refocus before taking a picture.
holdSteadyDelay Number <optional>
1.0 The delay for how long hold steady message should be shown before starting the capture.
pageDetectionEnabled Boolean <optional>
true A boolean that indicates whether the page detection constraint is enabled. If enabled this criteria is checked before taking a picture. Set it to NO in order to prevent page detection and suppress guidances messages like: center, zoomIn, zoomOut, rotate, etc.Default value is YES.
options.FarDetectionSettings Object <optional>
Fixed Aspect Ratio detection settings
Properties
Name Type Attributes Description
DetectionSettings Object <optional>
detection settings
Properties
Name Type Attributes Default Description
centerPoint Object <optional>
center point of the document. Should just be a point with in the bounds of the image height and width.
Properties
Name Type Attributes Description
x Number <optional>
x value of the center. Should just be with in the bounds of the image of the target frame.
y Number <optional>
y value of the center. Should just be with in the bounds of the image of the target frame.
aspectRatio Number <optional>
0.6296296296 aspect ratio of the document. Aspect ratio between 0 and 1 or negative is not recommended. It can result in erroneous detection of target frame. The aspect ratio is presented in the format of longEdge/shortEdge, and is used to construct the largest target frame. If the targetFrameAspectRatio is set to 0, then it will be automatically reset to an image aspect ratio.
padding Number <optional>
8 padding percent value. Values will be clamped to the range [0-50]. The default value is 8.
See:
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back errorCallback - error message would contain the appropriate error description.Possible error objects are Wrong Parameters, KmcRuntimeException & Exception.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var imageCaptureControlID = null, fixedAspectRatioExperienceOptions = null;
var fixedAspectRatioCaptureExperience =  kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});

fixedAspectRatioCaptureExperience.bindCaptureControl(successCallback,errorCallback,imageCaptureControlID);
//get the options
fixedAspectRatioCaptureExperience.getOptions(function(options){fixedAspectRatioCaptureExperienceOptions = options;},errorCallback);
//specify the path for tutorial sample image, which is relative to www folder.
fixedAspectRatioCaptureExperience.LookAndFeel.tutorialSampleImagePath = 'www/images/custom_tutorialimage.png';
// set the options to capture view
fixedAspectRatioCaptureExperience.setOptions(successCallback,errorCallback,fixedAspectRatioCaptureExperienceOptions)

stopCapture(successCallback, errorCallback)

Calling this method will stop the image capture process. In case of continuous capture also no further images would be captured after this API is called even if the device declination is changed
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back. errorCallback - error message would contain the appropriate error description.Possible error objects are KmcRuntimeException & Exception.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var imageCaptureControlID = null;
var fixedAspectRatioCaptureExperience =  kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});

fixedAspectRatioCaptureExperience.bindCaptureControl(successCallback,errorCallback,imageCaptureControlID);
fixedAspectRatioCaptureExperience.stopCapture(successCallback,errorCallback);

takePicture(successCallback, errorCallback)

Calling this method will start the process of monitoring the various constraints passed to determine when a level, focused, and non-blurry shot of the document can be taken. The default level indicator will not be rendered unless the levelIndicator property is set to true. The event listener "addImageCapturedListener" will receive the delegate call back message and will have the corresponding capture image details.
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back. errorCallback - error message would contain the appropriate error description.Possible error objects are KmcRuntimeException & Exception
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var imageCaptureControlID = null;
var fixedAspectRatioCaptureExperience =  kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});
fixedAspectRatioCaptureExperience.bindCaptureControl(successCallback,errorCallback,imageCaptureControlID);
fixedAspectRatioCaptureExperience.takePicture(successCallback,errorCallback);

takePictureContinually(successCallback, errorCallback)

Calling this method will start the process of monitoring the various constraints passed to determine when a level, focused, and non-blurry shot of the document can be taken. The default level indicator will not be rendered unless the levelIndicator property is set to true. The event listener "addImageCapturedListener" will receive the delegate call back message and will have the corresponding capture image details. This method will take pictures continuously. The pitch or roll of the device has to be changed from the set device declination values between each capture
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back. errorCallback - error message would contain the appropriate error description.Possible error objects are KmcRuntimeException & Exception.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var imageCaptureControl =  kfxCordova.kfxUicontrols.createImageCaptureControl();
var imageCaptureControlID = null;
var fixedAspectRatioCaptureExperience =  kfxCordova.kfxUicontrols.createFixedAspectRatioCaptureExperience();
imageCaptureControl.getId(function(captureControlID){
      imageCaptureControlID = captureControlID;
},function(error){
      alert(JSON.stringify(error));
});

fixedAspectRatioCaptureExperience.bindCaptureControl(successCallback,errorCallback,imageCaptureControlID);
fixedAspectRatioCaptureExperience.takePictureContinually(successCallback,errorCallback);