So, i have a problem with toImage() method. In the WebView i load an HTML with Canvas code to write something with your finger, you can watch the code here: https://github.com/Solitaryo/figerPaint
The first problem is when i put the toImage.media file inside a ImageView it saves the file but not what i write with my finger, only the "screenshot" or something like that.
//WebView var firma=$.webview.toImage().media; //ImageView $.imagenFirma.setImage(firma);The second problem is when i try to write the file in the gallery it doesn't work either... This is my function:
function guardarFirma(){ //Here i put the image inside "firma" var firma=$.webview.toImage().media; //I set the image to a ImageView but can't save what i wrote with my finger $.imagenFirma.setImage(firma); //The file name var firmaName="firma.jpg"; //Creating the place for the image var imageFile=Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, firmaName); if(imageFile.exists()){ //Trying to write the image imageFile.write(firma); alert("image saved"); } else{ alert("error"); } }I'm developing with:
Macbook Pro OS X 10.9.2 Titanium SDK 3.2.2 GA Titanium Studio, build: 3.2.1.201402041146 Device: Motorola XT910