CreativeSDK / phonegap-plugin-csdk-image-editor

A PhoneGap plugin for the Creative SDK Image Editor.
Apache License 2.0
35 stars 15 forks source link

How to customize Image Editor options? #3

Closed vernondegoede closed 8 years ago

vernondegoede commented 8 years ago

Hi there,

I managed to install the Phonegap plugin for my iOS app. Looks like a great plugin so far! I couldn't find much documentation on customising this plugin so I'm asking it here...

In the documentation* I read that, in order to set crop options, I had to set

// Disable the Custom and Original crop options, and do not allow the user to invert the settings.
[AdobeImageEditorCustomization setCropToolCustomEnabled:NO];
[AdobeImageEditorCustomization setCropToolInvertEnabled:NO];
[AdobeImageEditorCustomization setCropToolOriginalEnabled:NO];

But in which file am I supposed to do this? Should I add this directly to /Users/vernon/Apps/Doka/platforms/ios/Doka/Plugins/phonegap-plugin-csdk-image-editor/AdobeCreativeSDKImage.framework/Headers/AdobeImageEditorCustomization.h or is there a XML file which contains all these settings?

Thanks (again)!

vernondegoede commented 8 years ago

@macdonst

macdonst commented 8 years ago

@vernondegoede yeah, sorry we still have to write the README. Here is a quick example:

ImageEditor.edit(function(data) {
        console.log('win: ' + data);
        var testElements = document.getElementsByClassName('test');
        var testDivs = Array.prototype.filter.call(testElements, function(testElement){
            testElement.style.backgroundImage='url(' + data + ')';
        });
      }, function(e) {
        console.log('error: ' + e);
      }, 'http://36.media.tumblr.com/c066cc2238103856c9ac506faa6f3bc2/tumblr_nmstmqtuo81tssmyno1_1280.jpg', {
          "outputType": ImageEditor.OutputType.JPEG,
          "tools": [ImageEditor.ToolType.STICKERS, ImageEditor.ToolType.BLUR],
          "quality": 25
      });

You pass in the array of tools you want to use. You can see the list of tools in www/index.js.

vernondegoede commented 8 years ago

Awesome! Thanks. Documentation still needs a lot of work, yeah :(