Page 1 of 1

Camera Doesn't return control to LC

Posted: Mon Jul 01, 2019 7:34 pm
by trags3
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

Re: Camera Doesn't return control to LC

Posted: Mon Jul 01, 2019 7:52 pm
by Klaus
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

Re: Camera Doesn't return control to LC

Posted: Mon Jul 01, 2019 10:06 pm
by trags3
Thanks Klaus!
Tom

Re: Camera Doesn't return control to LC

Posted: Thu Jun 25, 2020 6:28 pm
by yunior.portilla
I am happy to share that I was able to get a snapshot of the camera using cameraControl. It really took a bit of work because the example in the help gave me an error ...

After reading a lot, I realized that the file extension should be jpeg, and that using binfile it saved the image well. The other detail is that even though cameraControlDo "myFirstCamera", "takePicture" is used, you must set "videoDevice" and "audioDevice "

I leave you the example here that is working perfectly for me.

These tests are carried out on Android, I suppose the problem is solved because the same thing was happening to me.