The leading provider of version control solutions and TWAIN SDKs
  • Contact us









GetSelectedImagesSize Method

Description

Pre-calculate the file size of the local image file that is saved from the selected images in buffer.

ActiveX Edition Plug-in Edition Mac Edition
Since V6.0 Since V6.0 Since V6.4

Syntax

Uint32 ObjectName. GetSelectedImagesSize(in long ImageType)

Parameters

in long ImageType: specifies the type of an image file.

Allowed Values

Image Type

0 BMP, DIB
1 JPG, JPEG, JPE, JFIF
2 TIF, TIFF
3 PNG
4 PDF

Return value

0 indicates failure. Other values indicate success.

When an error occurs and IfThrowException property is TRUE, an exception will be thrown.

When FALSE is returned or an exception is thrown, check ErrorCode property and ErrorString property for error information.

Remarks

If the image type is specified as TIFF/PDF, GetSelectedImagesSize returns the total size of selected images in Tiff/PDF. If the image type is BMP/JPEG/PNG, the method returns the size of the first selected image in BMP/JPEG/PNG.

See Also

SelectedImagesCount property, SaveSelectedImagesToBytes(), GetImageSize(), GetImageSizeWithSpecifiedType()

Sample

Javascript Sample:

	Webcam.SelectedImagesCount = 2;
	Webcam.SelectedImageIndex[0] = 4;// Set the 5th image as the first selected image.
	Webcam.SelectedImageIndex[1] = 3;// Set the 4th image as the second selected image.
	var size = Webcam.GetSelectedImagesSize(2); //Calculate the size of selected images in TIFF format
  	var ary = new Array(size);
        for (var i =0; i<size; i++)
            ary[i] = 0;
	Webcam.SaveSelectedImagesToBytes(size, ary);