Saves the image of a specified index in buffer as a JPEG file.
Namespace: Dynamsoft.DotNet.TWAINAssembly: DynamicDotNetTWAIN (in DynamicDotNetTWAIN.dll) Version: 3.0.0.0 (3.0.0.0)
Syntax
| C# |
|---|
public bool SaveAsJPEG( string strFileName, short sImageIndex ) |
| Visual Basic |
|---|
Public Function SaveAsJPEG ( _ strFileName As String, _ sImageIndex As Short _ ) As Boolean |
Parameters
- strFileName
- Type: System..::..String
The name of the JPEG file to be saved. It should be a local path on the local disk.
- sImageIndex
- Type: System..::..Int16
Specifies the index of image in buffer. The index is 0-based.
Return Value
True indicates success. False indicates failure.
Remarks
JPEG compression is a built-in feature of Dynamic .NET TWAIN, no other DLLs are required.
JPEG standard defines that only 256 gray-scaled image and 24 bit RGB image can be compressed as JPEG format.
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. |