Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Paint Module. Saving the image to parse. Possible?

$
0
0

Hi! i have successfully implemented the paint module onto my app. But is it possible to save the image into parse when i click the save button?

This is my current code.

var saveBtn = Ti.UI.createButton({ bottom:170, right:100, width:100, height:30, title:'Save' });
    saveBtn.addEventListener('click', function() {
    var filename = "sample.png";
    var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, filename);
 
    /*if (file.exists()) {
        file.deleteFile();
    }
*/
    file.write(paintView.toImage());
    var path = file.nativePath;
    Ti.API.info('path of image' + path);
    //alert('Image Save');
    });
    win.add(saveBtn);
 
//win.open();
 
};

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>