Programmatically open image crop option with App Control in Tizen Web
This code shows how to open Tizen Image Viewer crop option using Tizen App Control in Tizen Web app. An image named “home2.jpg” is used of “images” folder of file system to show the crop operation.
var imageFileSource= 'home2.jpg'; // target image
var imageSourceFolder = 'images'; // source folder of image in file system
tizen.filesystem.resolve(imageSourceFolder, function(images) {
var imagePath = images.resolve(imageFileSource);
var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/image/crop",
imagePath.toURI(),
"image/*", null , null);
tizen.application.launchAppControl(appControl, "tizen.imageviewer", successCb, errCb, null);
function successCb() {
console.log("Success");
}
function errCb() {
console.log("Failed");
}
});
// config.xml
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.read"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.write"/>
<tizen:privilege name="http://tizen.org/privilege/application.info"/>