Hello,
I am trying to capture a photo and display it using media.capturePhoto()
I don’t think the onComplete listener is firing. Here is the code;
-- Callback listener local function onPhotoComplete(event) local image = event.target if image then -- center image on screen image.x = halfW image.y = halfH end end -- Go to camera local function takePhoto( event ) if media.hasSource( media.Camera ) then media.capturePhoto( { listener = onPhotoComplete } ) else native.showAlert("Corona", "Camera not found.") end return true end -- Button to press for camera local btn = widget.newButton { width = profileHeight, height = profileHeight, left = leftPadding, top = halfH - profileHeight/2 - (heightOfFooter - heightOfHeader) /2, id = "profilePicture", defaultFile = userProfile["profilePicture"], onEvent = takePhoto }
I have been testing a variety of things, but can’t seem to get this to work. That is, display the image on screen or do anything in the onPhotoComplete listener.
I have tested on a HTC One and Galaxy Note II with no luck.
Thanks for any help,
Andy