new ImageObject(image)
Parameters:
Name | Type | Description |
---|---|---|
image |
image properties which are used to create the image object |
Methods
base64Image(successCallback, errorCallback)
Method to convert an image to the form of base64string from a Image.
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 ErrorMsg & ErrorDesc' giving the description of the error.
Returns:
The return value is captured in the 'successCallback' function and will have the base64 string of the image
successCallback - Get the base 64 string.
errorCallback - Error message would contain the appropriate error description.Possible error is Wrong ImageID.
Example
function successCallback(response){
alert(JSON.stringify(response));
}
function errorCallback(error){
alert(JSON.stringify(error));
}
var imageObj = kfxCordova.kfxEngine.createImageObject();
imageObj.base64Image(successCallback,errorCallback);
clearImageBitmap(successCallback, errorCallback)
Method to clear the image bitmap of the KEDImage. clearImageBitmap method of Image is used here.
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 'ErrorMsg' & 'ErrorDesc' giving the description of the error.
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 errors are Failed to complete Action - check parameters passed,KmcRuntimeException,KmcException.
Example
function successCallback(response){
alert(JSON.stringify(response));
}
function errorCallback(error){
alert(JSON.stringify(error));
}
var imageObj = kfxCordova.kfxEngine.createImageObject();
imageObj.clearImageBitmap(successCallback,errorCallback);
deleteFileFromDisk(successCallback, errorCallback)
Method to delete the image from disk. deleteFile method of Image is used here.
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 'ErrorMsg' & 'ErrorDesc' giving the description of the error.
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 errors are Failed to complete Action - check parameters passed,KmcRuntimeException,KmcException.
Example
function successCallback(response){
alert(JSON.stringify(response));
}
function errorCallback(error){
alert(JSON.stringify(error));
}
var imageObj = kfxCordova.kfxEngine.createImageObject();
imageObj.deleteFileFromDisk(successCallback,errorCallback);
deleteImage(successCallback, errorCallback)
Method to delete the imageObject (Image).
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 ErrorMsg & ErrorDesc' giving the description of the error.
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 is KmcException.
Example
function successCallback(response){
alert(JSON.stringify(response));
}
function errorCallback(error){
alert(JSON.stringify(error));
}
var imageObj = kfxCordova.kfxEngine.createImageObject();
// do operations with the created image, then to remove the image use
imageObj.deleteImage(successCallback,errorCallback);
getBlob(successCallback, errorCallback)
Method to get raw binary data buffer of the Image.
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 ErrorMsg & ErrorDesc' giving the description of the error.
Returns:
The return value is captured in the 'successCallback' function and will have ArrayBuffer of the image.
successCallback - Get the image ArrayBuffer.
errorCallback - Error message would contain the appropriate error description.Possible errors are Wrong ImageID, ArrayBuffer conversion failed.
Example
function successCallback(response){
alert(JSON.stringify(response));
}
function errorCallback(error){
alert(JSON.stringify(error));
}
var imageObj = kfxCordova.kfxEngine.createImageObject();
imageObj.getBlob(successCallback,errorCallback);
getImageSize(successCallback, errorCallback)
Method to get the image size for an Image.
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 'ErrorMsg' & 'ErrorDesc' giving the description of the error.
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 imageObj = kfxCordova.kfxEngine.createImageObject();
imageObj.getImageSize(successCallback,errorCallback);
imageReadFromFile(successCallback, errorCallback)
Method to get the image bitmap of the Image from disk. imageReadFromFile method of Image is used here.
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 'ErrorMsg' & 'ErrorDesc' giving the description of the error.
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCB' 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 errors are Failed to complete Action - check parameters passed,KmcRuntimeException,KmcException.
Example
function successCallback(response){
alert(JSON.stringify(response));
}
function errorCallback(error){
alert(JSON.stringify(error));
}
var imageObj = kfxCordova.kfxEngine.createImageObject();
imageObj.imageReadFromFile(successCallback,errorCallback);
imageWriteToFile(successCallback, errorCallback, parameters)
Method to write the Images to a disk. SpecifyFilePath and imageWriteToFile methods of Image are used here.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
successCallback |
function | Default Success call back function name | ||||||||||||
errorCallback |
function | Default Error call back function name | ||||||||||||
parameters |
Object | image Id you would like to write and File Path where you want to write.
Properties
|
- 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 'ErrorMsg' & 'ErrorDesc' giving the description of the error.
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 errors are Failed to complete Action - check parameters passed,Failed to write Image to File - Given Image already in File format.,
Given File extension is different from Image Mime Type,File path is Invalid,KmcRuntimeException,KmcException.
Example
function successCallback(response){
alert(JSON.stringify(response));
}
function errorCallback(error){
alert(JSON.stringify(error));
}
var imageObj = kfxCordova.kfxEngine.createImageObject();
imageObj.imageWriteToFile(successCallback,errorCallback,{
imageID:"imageID value",
filePath:"imageName.png"
});
setOptions(successCallback, errorCallback, parameters)
Method to set the properties of the native Image class. This method will intern call the ImageArray.prototype.setImageProperties to set the properties for a particular image object in the array
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
successCallback |
function | Default Success call back function name | ||||||||||||||||||||||||||||||||
errorCallback |
function | Default Error call back function name | ||||||||||||||||||||||||||||||||
parameters |
Object | An 'ImageObject' variable containing the properties to be set to the Image object. The image is uniquely identified by its 'id' property.
Properties
|
- 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 ErrorMsg & ErrorDesc' giving the description of the error.
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 errors are Failed to complete Action - check parameters passed,KmcRuntimeException,JSONException.
Example
function successCallback(response){
alert(JSON.stringify(response));
}
function errorCallback(error){
alert(JSON.stringify(error));
}
var imageObj = kfxCordova.kfxEngine.createImageObject();
//Set the properties for the image object
imageObj.setOptions(successCallback,errorCallback,{
imageID: "Give imageID Here",
mimeType: "MIMETYPE_JPG",
dpi: 75,
tag: 1,
filePath: "imageName.png",
createDateTime: "Give ISO 8601 Date Format String Here",
jpegQuality: 75
});