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

Camera overlay

$
0
0

Hi

( iOS )

I trying to save overlay on top of the camera and save it ( both ) to ONE picture.

BUT the problem is when taking picture and saving it to photo gallery its show two picture the overlay separate and the picture separate,

anyone know to save both at same time i take picture ????

my code


var win = Ti.UI.currentWindow;

var overlayImage = Titanium.UI.createImageView({ width: 100, height: 100, image: 'img/call.png', saveToPhotoGallery:true, }); var myOverlay = Titanium.UI.createView({ touchEnabled: true, saveToPhotoGallery:true,

});

myOverlay.add(overlayImage);

Titanium.Media.showCamera({ //success: successMethod, // error: errorMethod, cancel: function(e) {}, overlay: myOverlay, saveToPhotoGallery: true, allowEditing: false, showControls: false, mediaTypes: ['public.image'] });

myOverlay.addEventListener('click', function(){

Titanium.Media.takePicture(function(e){

var tkeImg = e.media;

 var img = Titanium.UI.createImageView({ 
        image: tkeImg 

});

Ti.API.info('saving the image into photogallery');
    Titanium.Media.saveToPhotoGallery(img.image);

   Ti.API.info('saving the blob into photogallery');
   Titanium.Media.saveToPhotoGallery(img.toImage());

});

});


Thank you


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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