captureImage()

Description

Captures an image from the camera to a specified image viewer.

Syntax

DCSObject.camera.captureImage(string imageContainerId);

Parameters

<string> imageContainerId: The id of an image container.

Return value

bool

true indicates success. false indicates failure.

Remarks

This method is only supported under image mode. When the capture mode is document mode, it returns false and when you check getErrorString(), you will get an error "This operation is only supported under image mode.".

If the id of image viewer doesn't exist, you will get an error "The object [object name] does not exist.".

When image buffer is full, that is to say, count equals capacity, the newly acquired image will not be imported into the image buffer.

Example

function CaptureImage() {
    if (DCSObject) {
      DCSObject.camera.selectCamera("Integrated Camera");
      DCSObject.camera.playVideo();
      DCSObject.camera.captureImage("******"); //Captures an image to a specified image viewer.
    }
}

See Also

.camera.selectCamera()
.camera.playVideo()

Is this page helpful?

Leave a Reply

Your email address will not be published.