Display & UI

Methods
SetViewMode()
Properties
BackgroundColor BackgroundFillColor FitWindowType
Height IfAutoScroll IfFitWindow
ImageMargin MaxImagesInBuffer MouseShape
SelectionImageBorderColor Width Zoom
ShowPageNumber MouseX MouseY
Events
OnTopImageInTheViewChanged OnMouseClick
OnMouseDoubleClick OnMouseMove
OnMouseRightClick

Methods

SetViewMode()
Sets how the images are displayed in Dynamic Web TWAIN viewer.
Syntax .SetViewMode(sHorizontalImageCount, sVerticalImageCount);
Parameters number sHorizontalImageCount: specifies the number of columns.
number sVerticalImageCount: specifies the number of rows.
Return value Void
Example
// Zoom is valid only when the view mode is set to -1 by -1.
DWObject.SetViewMode(-1,-1);  
DWObject.Zoom =  DWObject.Zoom * 1.2;  // Zoom in
DWObject.Zoom =  DWObject.Zoom / 1.2;  // Zoom out
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v5.0 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
Usage notes The default view mode is 1 by 1.
When the view mode is set to -1 by -1, Dynamic Web TWAIN only shows the current image. No scroll bar is provided to navigate to other images.
When the view mode is set to m (m>0) by n (n>0), a vertical scroll bar will be provided to navigate to other images.
When the view mode is set to n (n>=1) by -1, a horizontal scroll bar will be provided to navigate to other images.

Properties

BackgroundColor
Returns or sets the background color of the built-in viewer.
Type number
Accessors Get Set
Usage notes Default is white (0xffffff). The byte-ordering of the 24-bit RGB value is RRGGBB. RR represents red, GG represents green and BB represents blue.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v6.0 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
BackgroundFillColor
Returns or sets the fill color of the selected area of an image when it is cut, erased or rotated. It is a value specifying the 24-bit RGB value.
Type number
Accessors Get Set
Usage notes Default is white (0xffffff). The byte-ordering of the 24-bit RGB value is RRGGBB. RR represents red, GG represents green and BB represents blue.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v6.0 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
FitWindowType
Returns or sets how the image is/should be resized to fit to the width or height of the Dynamic Web TWAIN viewer. To use the property, the view mode should be set to -1 by -1.
Type number
Accessors Get Set
Usage notes Before change the value of FitWindowType, make sure you have set the view mode to -1 by -1 using SetViewMode.
Besides, if you want to change the value of FitWindowType after Zoom in/out, make sure set the property IfFitWindow to true.
Allowed Values Fit Window Type
0 (default) Fit the image to both the width and height of
the viewer
1 Fit the image to the height of the viewer
2 Fit the image to the width of the viewer
When an error occurs, check ErrorCode or ErrorString for error information.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v6.2 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
Height
Returns or sets the viewer height (in px) of a Dynamic Web TWAIN instance on the page.
Type number
Accessors Get Set
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v6.2 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
IfAutoScroll
Returns or sets whether to display the newly added image or keep the current one after an image(s) is imported into the Dynamic Web TWAIN viewer.
Type boolean
Accessors Get Set
Usage notes This property is valid only in the ActiveX Edition and the HTML5 Edition from v12.0.
This property doesn't work when the view mode is set to -1 by -1.
The default value of the IfAutoScroll property is true.
If set to true, it will display the newly added image. If set to false, it will display the current one.
When an error occurs, check ErrorCode or ErrorString for error information.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v12.0 ✓ | v12.0 ✓ | v12.0 ✓ | v12.0 ✓ | v12.1
IfFitWindow
Returns or sets whether to resize the image to fit both the width and height of the Dynamic Web TWAIN viewer. To use the property, the view mode should be set to -1 by -1.
Type boolean
Accessors Get Set
Usage notes Before change the value of IfFitWindow, make sure you have set the view mode to -1 by -1 using SetViewMode.
The default value of the IfFitWindow property is true.
When the value is 'false', the image will be displayed in its full size and scroll bars will appear if necessary (the width or height of the image is bigger than the viewer size).
When an error occurs, check ErrorCode or ErrorString for error information.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v5.1 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
ImageMargin
Returns or sets the margin between images when multiple images are displayed in Dynamic Web TWAIN viewer.
Type number
Accessors Get Set
Usage notes The default value will auto judge.
When an error occurs, check ErrorCode or ErrorString for error information.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v5.0 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
MaxImagesInBuffer
Returns or sets how many images are allowed to be acquired.
Type number
Accessors Get Set
Usage notes The default value of this property is 32767.
If you set MaxImagesInBuffer to be smaller than HowManyImagesInBuffer, the extra images in buffer will be removed.
When image buffer is full, that is HowManyImagesInBuffer equals MaxImagesInBuffer, the newly acquired or loaded image will replace the existing ones from the first one on.
When an error occurs, check ErrorCode or ErrorString for error information.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v4.0 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
MouseShape
Returns or sets the shape of the mouse (cursor).
Type boolean
Accessors Get Set
Usage notes When the property is true, the cursor is set as 'hand'.
If the width or height of the image is bigger than the Dynamic Web TWAIN viewer, scroll bars will appear and you can drag the image to adjust the position.
When the property is false, the cursor is set as 'crosshair'.
You can then select a rectangular area on Dynamic Web TWAIN viewer directly. After that, the event OnImageAreaSelected will fire and you can do things like 'crop the selected area'.
When an error occurs, check ErrorCode or ErrorString for error information.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v5.1 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
MouseX
Returns the X co-ordinate of the mouse. This is a read-only property.
Type number
Accessors Get
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v6.1 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
MouseY
Returns the Y co-ordinate of the mouse. This is a read-only property.
Type number
Accessors Get
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v6.1 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
SelectionImageBorderColor
Returns or sets the border color of the selected image. It is a value specifying the 24-bit RGB value.
Type number
Accessors Get Set
Usage notes The default value is light blue 0x7DA2CE. Please NOTE that the byte-ordering of the 24-bit RGB value is RRGGBB. RR represents red, GG represents green and BB represents blue.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v6.0 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
ShowPageNumber
Returns or sets whether to show the page number at the top left corner of the viewer.
Type boolean
Accessors Get Set
Usage notes This property only works in the HTML5 Edition from v10.2.
If the property is true, the page number will be displayed at the top left corner of the viewer.
If it is false, the page number will not be displayed.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v10.2 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
Width
Returns or sets the viewer width (in px) of a Dynamic Web TWAIN instance on the page.
Type number
Accessors Get Set
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v6.2 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
Zoom
Returns or sets zoom factor for the image, only valid when the view mode is set to -1 by -1.
Type number
Accessors Get Set
Usage notes The viewer will refresh to reflect the change of Zoom.
Before change the value of Zoom, make sure you have set the view mode to -1 by -1 using SetViewMode.
Also make sure you have set IfFitWindow to false.
The zoom value is expressed as a percentage. The valid range is from 2 to 6500 percent (Value: 0.02 ~ 65.0); the default value is 100 percent (Value: 1.0). A zoom value can be specified before or after an image is displayed. When the zoom value is changed, the displayed image will refresh automatically.
When an error occurs, check ErrorCode or ErrorString for error information.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v5.2 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1

Events

OnMouseClick
This event is triggered when the mouse clicks on an image in Dynamic Web TWAIN viewer.
Syntax .RegisterEvent('OnMouseClick',function(sImageIndex){...});
Arguments
  • number sImageIndex: The index of the image.
Example
DWObject.RegisterEvent('OnMouseClick', function(sImageIndex){
    alert(sImageIndex);
});
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v5.0 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
OnMouseDoubleClick
This event is triggered when the mouse double clicks on an image in Dynamic Web TWAIN viewer.
Syntax .RegisterEvent('OnMouseDoubleClick',function(sImageIndex){...});
Arguments
  • number sImageIndex: The index of the image.
Example
DWObject.RegisterEvent('OnMouseDoubleClick', function(sImageIndex){
    alert(sImageIndex);
});
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v5.1 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
OnMouseMove
This event is triggered when the mouse hovers over an image in Dynamic Web TWAIN viewer.
Syntax .RegisterEvent('OnMouseMove',function(sImageIndex){...});
Arguments
  • number sImageIndex: The index of the image.
Example
DWObject.RegisterEvent('OnMouseMove', function(sImageIndex){
    alert(sImageIndex);
});
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v5.0 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
OnMouseRightClick
This event is triggered when the mouse right clicks on an image in Dynamic Web TWAIN viewer.
Syntax .RegisterEvent('OnMouseRightClick',function(sImageIndex){...});
Arguments
  • number sImageIndex: The index of the image which was clicked upon.
Example
DWObject.RegisterEvent('OnMouseRightClick', function(sImageIndex){
    alert(sImageIndex);
});
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v5.1 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
OnTopImageInTheViewChanged
This event is triggered when the top image currently displayed in Dynamic Web TWAIN viewer changes.
Syntax .RegisterEvent('OnTopImageInTheViewChanged',function(sImageIndex){...});
Arguments
  • number sImageIndex: The index of the image.
Example
DWObject.RegisterEvent('OnTopImageInTheViewChanged', function(sImageIndex){
    alert(sImageIndex);
});
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v5.1 ✓ | v10.1 ✓ | v11.0 ✓ | v11.0 ✓ | v12.1
Usage notes The returned value sImageIndex means the index of the top image. When sImageIndex equals -1, it indicates that there is no image in buffer.

results matching ""

    No results matching ""

    results matching ""

      No results matching ""