TWAIN ActiveX/Plug-in Windows/Mac HTTP Control/SDK

OnPreTransfer

Description

Fired before a transfer begins.

Support information

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

Syntax

Object_OnPreTransfer()

Remarks

This is the place to read the properties of image information: ImageBitsPerPixel property, ImagePixelType property, ImageLength property, ImageWidth property, ImageXResolution property, ImageYResolution property, ImageLayoutDocumentNumber property, ImageLayoutFrameLeft property, ImageLayoutFrameTop property, ImageLayoutFrameRight property, ImageLayoutFrameBottom property, ImageLayoutPageNumber property, ImageLayoutFrameNumber property. 

This is also the place to call CancelAllPendingTransfers().

See Also

OnPreAllTransfers Event, OnPostAllTransfers Event, OnPostTransfer Event, OnTransferCancelled Event, OnTransferError Event.

Sample

A JavaScript sample is provided.

<script type="text/javascript" language="javascript">

WebTWAIN = document.getElementById("DynamicWebTwain");

//IE
WebTWAIN.attachEvent('OnImageAreaDeSelected', DynamicWebTwain_OnImageAreaDeselected);
WebTWAIN.attachEvent('OnImageAreaSelected', DynamicWebTwain_OnImageAreaSelected);
WebTWAIN.attachEvent('OnMouseClick', DynamicWebTwain_OnMouseClick);
WebTWAIN.attachEvent('OnMouseDoubleClick', DynamicWebTwain_OnMouseDoubleClick);
WebTWAIN.attachEvent('OnMouseMove', DynamicWebTwain_OnMouseMoveClick);
WebTWAIN.attachEvent('OnMouseRightClick', DynamicWebTwain_OnMouseRightClick);
WebTWAIN.attachEvent('OnPreAllTransfer', DynamicWebTwain_OnPreAllTransfer);
WebTWAIN.attachEvent('OnPreTransfer', DynamicWebTwain_OnPreTransfer);
WebTWAIN.attachEvent('OnPostLoad', DynamicWebTwain_OnPostLoad);
WebTWAIN.attachEvent('OnPostTransfer', DynamicWebTwain_OnPostTransfer);
WebTWAIN.attachEvent('OnPostAllTransfers', DynamicWebTwain_OnPostAllTransfers);
WebTWAIN.attachEvent('OnTopImageInTheViewChanged', DynamicWebTwain_OnTopImageInTheViewChanged);
WebTWAIN.attachEvent('OnTransferCancelled', DynamicWebTwain_OnTransferCancelled);
WebTWAIN.attachEvent('OnInternetTransferPercentage', DynamicWebTwain_OnInternetTransferPercentage);
WebTWAIN.attachEvent('OnInternetTransferPercentageEx', DynamicWebTwain_OnInternetTransferPercentageEx);

//Non-IE
<embed id='DynamicWebTwain' type='Application/DynamicWebTwain-Plugin'
    OnImageAreaDeSelected = 'DynamicWebTwain_OnImageAreaDeselected'
    OnImageAreaSelected = 'DynamicWebTwain_OnImageAreaSelected'
    OnMouseClick = 'DynamicWebTwain_OnMouseClick'
    OnMouseDoubleClick = 'DynamicWebTwain_OnMouseDoubleClick'
    OnMouseMove = 'DynamicWebTwain_OnMouseMove'
    OnMouseRightClick = 'DynamicWebTwain_OnMouseRightClick'
    OnPreAllTransfer = 'DynamicWebTwain_OnPreAllTransfer'
    OnPreTransfer = 'DynamicWebTwain_OnPreTransfer'
    OnPostLoad = 'DynamicWebTwain_OnPostLoad'
    OnPostTransfer = 'DynamicWebTwain_OnPostTransfer'
    OnPostAllTransfers = 'DynamicWebTwain_OnPostAllTransfers'
    OnTopImageInTheViewChanged = 'DynamicWebTwain_OnTopImageInTheViewChanged'
    OnTransferCancelled = 'DynamicWebTwain_OnTransferCancelled'
    OnInternetTransferPercentage = 'DynamicWebTwain_OnInternetTransferPercentage'
    OnInternetTransferPercentageEx = 'DynamicWebTwain_OnInternetTransferPercentageEx'
></embed>
...

function DynamicWebTwain_OnImageAreaDeselected(sImageIndex){
	// Add your code here
}
function DynamicWebTwain_OnImageAreaSelected(sImageIndex, left, top, right, bottom){
	// Add your code here
}
function DynamicWebTwain_OnMouseClick(sImageIndex){
	// Add your code here
}
function DynamicWebTwain_OnMouseDoubleClick(sImageIndex){
	// Add your code here
}
function DynamicWebTwain_OnMouseMoveClick(sImageIndex){
	// Add your code here
}
function DynamicWebTwain_OnMouseRightClick(sImageIndex){
	// Add your code here
}
function DynamicWebTwain_OnPreAllTransfer(){
	// Add your code here
}
function DynamicWebTwain_OnPostLoad(){
	// Add your code here
}
function DynamicWebTwain_OnPostTransfer(){
	// Add your code here
}
function DynamicWebTwain_OnPostAllTransfers(){
	// Add your code here
}
function DynamicWebTwain_OnTopImageInTheViewChanged(sImageIndex){
	// Add your code here
}
function DynamicWebTwain_OnTransferCancelled(sImageIndex, left, top, right, bottom){
	// Add your code here
}
function DynamicWebTwain_OnInternetTransferPercentage(sPercent, pCancel){
	// Add your code here
}
function DynamicWebTwain_OnInternetTransferPercentageEx(sPercent, pCancel){
	// Add your code here
}




TWAIN ActiveX | TWAIN Plug-in | TWAIN Control | TWAIN SDK | Scanner COM
Software Configuration Management | Version Control | Source Control
Copyright © 2012 Dynamsoft Corporation. All Rights Reserved.