hi,
I have a question, is it possible to save an image from a view to a chosen folder on the iphone? I have been searching, but the only thing i found is save in media photoGallery directory. Can someone help me? Many thanks!
this is what i have now to save it:
var painter = Titanium.Painter.createView({ top:10, left:10, right:10, height:800 });
b2.addEventListener('click', function(){ Ti.Media.saveToPhotoGallery(painter.toImage()); }); Ti.Media.saveToPhotoGallery(painter.toImage());
2 Answers
once you get the media object, you can save the image to a file within the specific applications sandbox. See the sample file from the Kitchen Sink below
fixed
var new_folder = Titanium.Filesystem.getFile(parent, 'test'); if( !new_folder.exists() ) { new_folder.createDirectory(); }
});
var theMap = painter.toImage(); theMap.size; var d=new Date(); var filename = d.getTime() + ".png"; var f = Titanium.Filesystem.getFile(parent + '/test',filename); f.write(theMap);
});
Thanks for the help mate :)
Your Answer
Think you can help? Login to answer this question!