Standalone picture taking

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
simon.schvartzman
Posts: 665
Joined: Tue Jul 29, 2014 12:52 am

Standalone picture taking

Post by simon.schvartzman » Sat Jan 14, 2017 2:52 pm

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.
Simon
________________________________________
To ";" or not to ";" that is the question

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10123
Joined: Fri Feb 19, 2010 10:17 am

Re: Standalone picture taking

Post by richmond62 » Sat Jan 14, 2017 5:20 pm

If you look up "export snapshot" in the in-built
documentation things are explained pretty comprehensibly.
Camera.png
Camera.png (35.88 KiB) Viewed 5955 times
My First Camera.livecode.zip
Here's the stack.
(7.79 KiB) Downloaded 252 times
Have lots of fun, and hack it to bits!

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10123
Joined: Fri Feb 19, 2010 10:17 am

Re: Standalone picture taking

Post by richmond62 » Sat Jan 14, 2017 7:07 pm

goForIt.png

simon.schvartzman
Posts: 665
Joined: Tue Jul 29, 2014 12:52 am

Re: Standalone picture taking

Post by simon.schvartzman » Sat Jan 14, 2017 8:42 pm

@richmond62, many thanks for your prompt and useful answer, it really helps.

Best!
Simon
________________________________________
To ";" or not to ";" that is the question

simon.schvartzman
Posts: 665
Joined: Tue Jul 29, 2014 12:52 am

Re: Standalone picture taking

Post by simon.schvartzman » Mon Jan 16, 2017 1:44 pm

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
Simon
________________________________________
To ";" or not to ";" that is the question

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10123
Joined: Fri Feb 19, 2010 10:17 am

Re: Standalone picture taking

Post by richmond62 » Mon Jan 16, 2017 7:56 pm

I'm sorry, I haven't a clue as I have little or no interest in iOS.

simon.schvartzman
Posts: 665
Joined: Tue Jul 29, 2014 12:52 am

Re: Standalone picture taking

Post by simon.schvartzman » Mon Jan 16, 2017 9:53 pm

Got it thanks anyway...

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

Best regards
Simon
________________________________________
To ";" or not to ";" that is the question

simon.schvartzman
Posts: 665
Joined: Tue Jul 29, 2014 12:52 am

Re: Standalone picture taking

Post by simon.schvartzman » Thu Jan 19, 2017 3:49 pm

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
Simon
________________________________________
To ";" or not to ";" that is the question

Post Reply