Page 1 of 1

Standalone picture taking

Posted: Sat Jan 14, 2017 2:52 pm
by simon.schvartzman
Hi, I would like to develop what I think is a simple stack but not sure it if is possible.

What I want to accomplish is basically to take a picture, without user intervention, at given time intervals.

I guess using local notification will perfectly deal with the Time Intervals aspect but I can't figure out how to take the picture under stack control.

Any hints will be greatly appreciated.

Re: Standalone picture taking

Posted: Sat Jan 14, 2017 5:20 pm
by richmond62
If you look up "export snapshot" in the in-built
documentation things are explained pretty comprehensibly.
Camera.png
Camera.png (35.88 KiB) Viewed 5953 times
My First Camera.livecode.zip
Here's the stack.
(7.79 KiB) Downloaded 251 times
Have lots of fun, and hack it to bits!

Re: Standalone picture taking

Posted: Sat Jan 14, 2017 7:07 pm
by richmond62
goForIt.png

Re: Standalone picture taking

Posted: Sat Jan 14, 2017 8:42 pm
by simon.schvartzman
@richmond62, many thanks for your prompt and useful answer, it really helps.

Best!

Re: Standalone picture taking

Posted: Mon Jan 16, 2017 1:44 pm
by simon.schvartzman
Hi @richmond62, sorry for bother you again but can't get the stack to work on iOS (using the simulator)...

Have you tried it? Does it work for you? I guess I'm missing something.

To be more precise I would like to save the taken picture to the photo album.

Thanks for any help

Re: Standalone picture taking

Posted: Mon Jan 16, 2017 7:56 pm
by richmond62
I'm sorry, I haven't a clue as I have little or no interest in iOS.

Re: Standalone picture taking

Posted: Mon Jan 16, 2017 9:53 pm
by simon.schvartzman
Got it thanks anyway...

If / When I make it work I will post the script for other potential users interested on it.

Best regards

Re: Standalone picture taking

Posted: Thu Jan 19, 2017 3:49 pm
by simon.schvartzman
This is the code I used to achieve my goal, just an Image control is needed to define the size of the virtual camera and show the picture that was taken

Code: Select all

   -- set the virtual camera
   cameraControlCreate"myFirstCamera"
   cameraControlSet "myFirstCamera", "device", "rear"
   cameraControlSet "myFirstCamera", "rect", the rect of image 1 
   cameraControlSet "myFirstCamera", "visible", true
   -- take the picture and show it 
   cameraControlDo "myFirstCamera", "takePicture"
   put the result into image 1
   -- save to album
   put the long ID of the last image into tImageID
   mobileExportImageToAlbum tImageID