Taking Pictures
Once you have a camera instance, it is simple to capture a picture.
Take Picture
Invoke the takePicture
method to capture a picture from the camera.
This method takes a PictureCaptureHandler
parameter - in this example the
picture will be saved to disk:
An alternate takePicture
is also provided, allowing you to specify a capture
delay before taking the picture. This can useful, especially when taking the
first picture after opening the camera, to give the camera sensor some time to
"settle" before taking the picture. Use whatever delay values work for you.
Picture capture handlers will be explained in the next tutorial.
A camera must be "opened" before taking any pictures. When the camera is first created it is also automatically opened so ordinarily you do not need to consider it. This becomes important when dealing with capture failures as you can close and reopen the camera to try and recover from the error. This will be explained further in a later tutorial.