Camera Doesn't return control to LC

Getting into LiveCode for iOS? Ask your questions here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
trags3
Posts: 298
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

Camera Doesn't return control to LC

Post by trags3 » Mon Jul 01, 2019 7:34 pm

Hello All,
I am trying to have my app allow the user to take a picture.
I have a button called "Take Picture"
Following the code in the dictionary the code for this button is:

on mouseUp
cameraControlCreate "myCamera"
cameraControlSet "myCamera", "rect", (20, 25, 418, 600)
cameraControlSet "myCamera", "visible", "true"
cameraControlSet "myCamera", "device", "back"

mobilePicPhoto "myCamera", 212,122
end mouseUp
Once the Camera is launched the image from the camera is on the screen (live). The Camera controls never show up and therefore an image is never taken. I can navigate to other cards but the camera image is always on the screen.
Help Please,
Tom

Klaus
Posts: 11207
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Camera Doesn't return control to LC

Post by Klaus » Mon Jul 01, 2019 7:52 pm

Hi Tom,

looks like you are mixing two different commands -> mobilepickphot and cameracontrol
So you either use cameracontrol throughout:

Code: Select all

...
cameraControlCreate "myCamera"
cameraControlSet "myCamera", "rect", (20, 25, 418, 600)
cameraControlSet "myCamera", "visible", "true"
cameraControlSet "myCamera", "device", "back"
## !!
cameraControlDo "myCamera","takepicture"
put the result into img "your image control here"
cameracontroldelete "myCamera"
...
Or just use mobilepickphoto:

Code: Select all

...
mobilePickPhoto "front camera",400,400
...
Best

Klaus

trags3
Posts: 298
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

Re: Camera Doesn't return control to LC

Post by trags3 » Mon Jul 01, 2019 10:06 pm

Thanks Klaus!
Tom

Post Reply

Return to “iOS Deployment”