Pre-calculates the file size of the local image file that is saved from an image of a specified index in buffer.
Namespace: Dynamsoft.DotNet.TWAINAssembly: DynamicDotNetTWAIN (in DynamicDotNetTWAIN.dll) Version: 3.0.0.0 (3.0.0.0)
Syntax
| C# |
|---|
public int GetImageSizeWithSpecifiedType( short sImageIndex, DWTImageFileFormat enumImageType ) |
| Visual Basic |
|---|
Public Function GetImageSizeWithSpecifiedType ( _ sImageIndex As Short, _ enumImageType As DWTImageFileFormat _ ) As Integer |
Parameters
- sImageIndex
- Type: System..::..Int16
Specifies the index of image in buffer. The index is 0-based.
- enumImageType
- Type: Dynamsoft.DotNet.TWAIN.Enums..::..DWTImageFileFormat
Specifies the type of an image file. DWTImageFileFormat Allowed Values Image Type 0 BMP, DIB 1 JPG, JPEG, JPE, JFIF 2 TIF, TIFF 3 PNG 4 PDF
Return Value
-1 indicates failure. Other values indicate success.
Remarks
Exceptions
| Exception | Condition |
|---|---|
| Dynamsoft.DotNet.TWAIN..::..TwainException | When an error occurs and IfThrowException property is true, an exception will be thrown. When IfThrowException property is false, please check ErrorCode and ErrorString. |