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

Take a image from camera and save with a name in ios

$
0
0

Application type:mobile,Titanium sdk:3.3.0,platform:ios,Device:ipad,OS:Mac OSX,Titanium studio:3.3.0

I am taking an image from camera and saving to the file system with a name.Where can I see the file system images in the iPad. If I use savetophotogallery option the image is shown in the gallery but saved with other name.

How can I save a image in gallery with a customized name .

Titanium.Media.showCamera({
            success : function(event) {
                var image = event.media;
                if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
                    var imageView = Ti.UI.createImageView({
                        width : win.width,
                        height : win.height,
                        image : event.media
                    });
                    win.add(imageView);
                    win.open();
                    var image=imageView.toImage();
                    var filename = win.title + "_" + win.comp+".jpg";
                    var f = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, filename);
                    f.write(image);
                    imageView.image = f.nativePath;
                    Ti.Media.hideCamera();
                }
            },
            cancel : function() {
            },
            error : function(error) {
            },
        //  saveToPhotoGallery : true,
            allowEditing : true,
            mediaTypes : [Ti.Media.MEDIA_TYPE_VIDEO, Ti.Media.MEDIA_TYPE_PHOTO],
        });

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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