Captures an image and saves it as a file.
Camera objects
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 |
Integer. Returns 1 for success, and one of the following negative values if an error occurs:
-7 Unsupported option, such as setting a property the camera does not recognize
-9 Bad OS version (for example, expecting Windows Mobile 5 support on a Windows Mobile 2003 device)
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.
HTC 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.
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