getSelectedIndices()

Description

Gets the indices of all images currently selected by Dynamsoft Camera SDK.

Syntax

ImageViewerObject.image.getSelectedIndices();

Return value

<int[]>

If it fails to get the indices, it returns null.

Remarks

The index is 0 based.

If no image is selected, the return value of this method is [].

When an error occurs, check getErrorCode() or getErrorString() for error information.

Example

             var imageviewer = DCSObject.getImageViewer ("ImageViewerContainer");  // Get a specified image viewer
             imageviewer.image.setSelectedIndices([0,1]); //Select the first and second images
             var arr = imageviewer.image.getSelectedIndices();
             for (var i = 0; i &lt; arr.length; i ++) {
                  console.log(arr[i]);
             }
       

See also

.image.setSelectedIndices()
.image.getCount()