Legacy Controls NOTICE
This article references our legacy Web Forms Web Viewing controls (WebImageViewer, WebAnnotationViewer, WebThumbnailViewer). It is preserved for archival purposes, but support strongly recommends using our modern HTML5 web controls: WebDocumentViewer, WebDocumentThumbnailer instead)
INFO: WebDocumentViewer Whitepaper - Getting Started With Web Viewing
Main Article Content
Enumeration Objects
The objects shown below are used to represent the enumerations that are used
within the server side portion of the DotImage WebControls. These objects do not
need to be instantiated.
Usage:
JavaScript |
|
/* You will need a reference to Enums.js before this snippet.
* This reference is automatically added to the page, inline with the WebControls,
* so placing this snippet below one of these controls will be sufficient.
*/
function EnumsExample(){
// Best fit the image to the size of the WebImageViewer
WebImageViewer1.setAutoZoom(AutoZoomMode.BestFit);
// Scale 1-bit images to 8-bit grayscale for zoom levels less than 1
WebImageViewer1.setAntialiasDisplay(AntialiasDisplayMode.ScaleToGray);
// Sets the mouse tool to zoom in on a left click, and zoom out on a right click
WebImageViewer1.setMouseTool(MouseToolType.ZoomIn, MouseToolType.ZoomOut);
// Sets the interact mode to modify for annotation editing
WebAnnotationViewer1.setInteractMode(AnnotationInteractMode.Modify);
// Sets the mouse cursor to a cross hair
WebImageViewer1.setMouseToolCursor(MouseToolCursor.Crosshair);
}
|
AutoZoomMode
This object mimics the Atalasoft.Imaging.WebControls.AutoZoomMode
enumeration, for use on the client side. Specifies the automatic zoom setting of
the image displayed in the control.
Properties
Server Name |
JavaScript Syntax |
Value |
Description |
None |
None |
0 |
Does not change the zoom of the image based on image size. |
BestFit |
BestFit |
1 |
Fits the image by sizing the width or height to best fit the
control. |
BestFitShrinkOnly |
BestFitShrinkOnly |
2 |
Fits the image by sizing the width or height to best fit the
control. |
FitToWidth |
FitToWidth |
3 |
Fits the image by sizing the width to fit the control. |
FitToHeight |
FitToHeight |
4 |
Fits the image by sizing the height to fit the control. |
FitToImage |
FitToImage |
5 |
Fits the image by sizing the control to the size of the
image. |
AntialiasDisplayMode
This object mimics the Atalasoft.Imaging.WebControls.AntialiasDisplayMode
enumeration, for use on the client side. Specifies the antialias display mode
that can be set to the control.
Properties
Server Name |
JavaScript Syntax |
Value |
Description |
None |
None |
0 |
Do not antialias (fastest performance) |
ScaleToGray |
ScaleToGray |
1 |
Only antialias 1-bit document images for zoom levels less then 1. |
ReductionOnly |
ReductionOnly |
2 |
Antialias all pixel formats when zoom level is less then 1. |
Full |
Full |
3 |
Antialias all images for all zoom levels. |
MouseToolType
This object mimics the Atalasoft.Imaging.WebControls.MouseToolType
enumeration, for use on the client side. Specifies the behavior of the
mouse.
Properties
Server Name |
JavaScript Syntax |
Value |
Description |
None |
None |
0 |
Specify no special mouse behavior. |
Center |
Center |
1 |
Clicking the mouse will center the area clicked. |
Selection |
Selection |
2 |
Mouse will be set to crosshairs and can be used to drag and modify a
selection rectangle on the image. |
ZoomIn |
ZoomIn |
3 |
Clicking will zoom in. |
ZoomOut |
ZoomOut |
4 |
Clicking will zoom out. |
ZoomArea |
ZoomArea |
5 |
Zoom in on a specified area defined by dragging a rectangle onto the
image. |
Pan |
Pan |
6 |
Clicking and dragging the mouse will scroll the image. |
PassThrough |
PassThrough |
7 |
Clicking on the image will postback the page, used for custom
MouseTools. |
ScrollBarVisibility
This object mimics the Atalasoft.Imaging.WebControls.ScrollBarVisibility
enumeration, for use on the client side. Specifies the scroll bar
visibility.
Properties
Server Name |
JavaScript Syntax |
Value |
Description |
Dynamic |
Dynamic |
0 |
Automatically show or hide the horizontal and vertical scrollbars as the
control or image resizes. |
None |
None |
1 |
Never show scroll bars. |
Always |
Always |
2 |
Always show scroll bars. |
AnnotationInteractMode
This object mimics the Atalasoft.Imaging.WebControls.AnnotationInteractMode
enumeration, for use on the client side. Specifies the annotation viewer
interaction mode (with the mouse)
Properties
Server Name |
JavaScript Syntax |
Value |
Description |
None |
None |
0 |
Do not allow interaction with an annotation -- pass through to
viewer |
Modify |
Modify |
2 |
Annotations can be selected, moved and resized using the mouse. |
Author |
Author |
3 |
Annotations can be created, selected, moved and resized using the
mouse. |
AnnotationTool
This object has no equivalent on the server side. Specifies the behavior of
the mouse when creating annotations. This object is currently only used
internally, as the WebAnnotationViewer automatically changes the AnnotationTool
based on the created annotation.
Properties
Server Name |
JavaScript Syntax |
Value |
Description |
N/A |
None |
0 |
No annotations are created |
N/A |
Line |
1 |
Line annotations are created by pressing the left mouse button down,
dragging, and releasing the button |
N/A |
Lines |
2 |
Multi-line annotations are created by left-clicking the mouse for each
point, right clicking stops editing |
N/A |
Freehand |
3 |
Freehand annotations are created by pressing the left mouse button down,
dragging, and releasing the button |
N/A |
Polygon |
4 |
Multi-side polygon annotations are created by left-clicking the mouse for
each point, right clicking stops editing |
N/A |
Ellipse |
5 |
Ellipse annotations are created by pressing the left mouse button down,
dragging, and releasing the button |
N/A |
Rectangle |
6 |
Rectangle annotations are created by pressing the left mouse button down,
dragging, and releasing the button |
MouseToolCursor
This object mimics the Atalasoft.Imaging.WebControls.MouseToolCursor
enumeration, for use on the client side. Specifies the cursor used with the
mouse tool.
Properties
Server Name |
JavaScript Syntax |
Value |
Description |
Auto |
Auto |
0 |
Mouse cursor is automatically set based on the MouseTool and
AnnotationTool |
Arrow |
Arrow |
1 |
Mouse cursor is an arrow |
Crosshair |
Crosshair |
2 |
Mouse cursor is a crosshair |
Grab |
Grab |
3 |
Mouse cursor is a grabbing hand |
Hand |
Hand |
4 |
Mouse cursor is a hand with the index finger pointing up |
Move |
Move |
5 |
Mouse cursor is a cross with arrows in all four directions |
ZoomIn |
ZoomIn |
6 |
Mouse cursor is a magnifying glass with a plus |
ZoomOut |
ZoomOut |
7 |
Mouse cursor is a magnifying glass with a minus |
Custom |
Custom |
8 |
Mouse cursor is defined by the MouseToolCustomCursor
value |
Original Article:
Q10359 - INFO: Enums - JavaScript API Reference (Legacy Web Controls)