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
Camera Doesn't return control to LC
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Camera Doesn't return control to LC
Hi Tom,
looks like you are mixing two different commands -> mobilepickphot and cameracontrol
So you either use cameracontrol throughout:
Or just use mobilepickphoto:
Best
Klaus
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"
...
Code: Select all
...
mobilePickPhoto "front camera",400,400
...
Klaus
Re: Camera Doesn't return control to LC
Thanks Klaus!
Tom
Tom
-
- Posts: 28
- Joined: Sat May 30, 2020 12:50 am
Re: Camera Doesn't return control to LC
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.
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.
- Attachments
-
- cameraControl.zip
- (1.58 KiB) Downloaded 184 times