How Do I Take a Photo?

In this lesson we will use the LCTakePhoto component to take a photo with the default camera.

Solution layout

In your solution create a container field (1) to hold the photo that is returned by LCTakePhoto and drag it out onto your layout (2).

Then add a button  (3) and in button setup name it and choose `Single Step` as its action.

Take Photo button script

The `Take Photo` button script is just a single script step to set the Photo container field to the result of the `LC( "LCTakePhoto" )` function.

Testing

Exit layout mode and click on the `Take Photo` button. The dialog will open and you will see something like the image below but with someone much prettier in the picture. Click the red camera button to start a capture countdown. The captured image will replace the camera preview. Clicking the red camera button again will show the camera preview and start another capture countdown to replace the captured image with a new one.

0 Comments

Add your comment

E-Mail me when someone replies to this comment