Dynamic Web TWAIN  - TWAIN ActiveX/Plug-in, Scanner COM Control
TWAIN ActiveX/Plug-in HTTP Control/SDK

SaveAsBMP Method

Description

Saves the image of a specified index in buffer as a BMP file.

Syntax

Boolean ObjectName. SaveAsBMP(String FileName, Short sImageIndex)

Parameters

String FileName: the name of the BMP file to be saved. It should be an absolute path on the local disk.

Short sImageIndex: specifies the index of image in buffer. The index is 0-based.

Return value

Boolean.

TRUE indicates success. FALSE indicates failure.

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 you would like to save images by showing the browser dialog box, you can set IfShowFileDialog to true.

See also

SaveAsJPEG(), SaveAsTIFF(), SaveAsPNG(), SaveAllAsMultiPageTIFF(), FTPUpload(), FTPDownload(), HTTPUploadThroughPut(), HTTPUploadThroughPost(), HTTPDownload()

Samples

Save new acquired image as a BMP file automatically after a transfer ends.

VB Sample:
Private Sub BeginScan()
    Twain.OpenSource
    Twain.IfShowUI = False    'Set without user interface
    Twain.IfDisableSourceAfterAcquire = True
    Twain.AcquireImage
End Sub
Private Sub Twain_OnPostTransfer()
Twain.SaveAsBMP "C:\SaveAsBMP.bmp", 0 End Sub

 

JavaScript Sample:
    

<script language="javascript"> function btnSaveBMP_onclick() {   frmScan.DynamicWebTwain1.SaveAsBMP("C:/ImageData.bmp",0); } </script>













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.