Page 1 of 1

cameraControlSet issue

Posted: Wed Nov 27, 2019 2:42 pm
by thatkeith
I'm refreshing my memory of LC tricks, which often means reminding myself of things by using examples from the LC Dictionary. The code samples provided there are very helpful... except when they don't work as expected – or at all. This is from the cameraControlCreate entry:

Code: Select all

   cameraControlCreate "myFirstCamera"
   cameraControlSet "myFirstCamera", "visible", true
   cameraControlSet "myFirstCamera", "rect", "50,50,500,500"
   cameraControlSet "myFirstCamera", "device", "front"
   cameraControlDo "myFirstCamera", "takePicture"
   put the result into url ("file:" & specialFolderPath("documents") & "/snapshot.jpg")
The cameraControlSet "myFirstCamera", "device", "front" line triggers an 'error in statement' entry in the revErrorDisplay window:

Code: Select all

Type	Handler: error in statement
Object	Button
Line	cameraControlSet "myFirstCamera", "device", "front"
Hint	mouseup
Any suggestions?

Keith

Re: cameraControlSet issue

Posted: Wed Nov 27, 2019 5:58 pm
by [-hh]
You probably don't have a front camera available (what cameraControl sees as "front").

Assuming you have any camera (built-in or webcam) attached, are you allowed to access that camera?
What happens if you omit that line?

See also the new version LC 9.6.0-dp1 that "upgraded" cameraControl for some scenarios.

This sample stack has scripts for using up to 2 intern or extern cameras:
(sorry, currently not available)