Pre-calculate the file size of the local image file that is saved from the selected images in buffer.
Uint32 ObjectName. GetSelectedImagesSize(in long ImageType)
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 |
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.
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.
SelectedImagesCount property, SaveSelectedImagesToBytes(), GetImageSize(), GetImageSizeWithSpecifiedType()
Javascript Sample:
Twain.SelectedImagesCount = 2;
Twain.SelectedImageIndex[0] = 4;// Set the 5th image as the first selected image.
Twain.SelectedImageIndex[1] = 3;// Set the 4th image as the second selected image.
var size = Twain.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;
Twain.SaveSelectedImagesToBytes(size, ary);
|
VB Sample:
Dim ary as Variant Twain.SelectedImagesCount = 2 Twain.SelectedImageIndex[0] = 4 Twain.SelectedImageIndex[1] = 3 Dim size as long Set size = Twain.GetSelectedImagesSize(2) Redim ary(size) as byte Twain.SaveSelectedImagesToBytes(size, ary) |
TWAIN ActiveX | TWAIN Plug-in | TWAIN Control | TWAIN SDK | Scanner COM
Software Configuration Management | Version Control | Source Control
Copyright © 2011 Dynamsoft Corporation. All Rights Reserved.