CaptureImage

Description

Captures an image and saves it as a file.

Applies to

Camera objects

Syntax

objectname.CaptureImage ( fileName )

Argument

Description

objectname

The name of the camera object that you want to inquire about

fileName

A string that specifies the name of the file to which the image is to be saved

Returns

Integer. Returns 1 for success, and one of the following negative values if an error occurs:

Usage

The image is saved as a file in JPEG format, or in a format specified using the CamOptCaptureFormat! value of the CameraOption enumerated variable. Some devices stop the preview when the capture begins and restart preview when the capture is complete. For a list of values of the CameraOption enumerated variable, see GetOption.

NoteHTC cameras You cannot use PowerScript image-capturing functions with cameras that depend on the IA Camera Wizard for these functions. Instead, you can use the Camera object Snapped event to retrieve the file name for an image that you capture using the IA Camera Wizard.

Examples

Example 1

The following example tests whether the image is ready to be captured before capturing it:

if g_mycamera.IsReadyForCapture() then
   li_rtn = g_myCamera.CaptureImage("\mypic.jpg")
end if

See also