TiledImageViewer Client Object
The LEADTOOLS TiledImageViewer control includes a client-side Javascript class to update the server control without posting the entire page back to the server. Most of the TiledImageViewer server properties can be accessed through the Javascript class. You can access the LEADTOOLS TiledImageViewer control on the client side by using the ASP.NET generated ClientID on the WebForm.
Client Naming
The client-side version of the control uses the same naming convention as the server control version for easier coding. All Leadtools public class definitions in the TiledImageViewer.js and Utilities.js files contain the prefix "ltwf" to avoid conflicts with any other components on the page.
Client Public Methods/Properties
All server-side object properties can be accessed on the client by using two methods: "GetServerPropertyName", and "SetServerPropertyName", where “ServerPropertyName” is replaced with the name of the property to be accessed or set.
The following table lists the Server properties and the mapped client methods:
Property Name(Server) | Method Name(Client) | Description | Input Type |
---|---|---|---|
N/A | ID | Gets the generated by ASP.NET control identifier. | - |
InputProfile |
GetInputProfile():string SetInputProfile(value: |
Gets and sets the name of the input profile xml file containing the load options to be used in loading the image file. |
|
OutputProfile |
GetOutputProfile():string SetOutputProfile(value: |
Gets and sets the name of the output profile XML file containing the save options to be used in saving the loaded image file before displaying it in the control. |
|
ImageUrl |
GetImageUrl():string SetImageUrl(value: |
Gets or sets the URL of the image to be displayed. |
|
GetScaleFactor(): SetScaleFactor(value: |
Gets or sets The zoom factor used to display the image. |
100 means displaying the image in original width/height (1:1). |
|
GetSizeMode(): SetSizeMode(value: |
Gets or sets how the control displays the image and the automatic adjustments of the display rectangles. |
||
GetHorizontalAlignMode(): SetHorizontalAlignMode(value: |
Gets or sets the horizontal alignment to display the image. |
||
GetVerticalAlignMode(): SetVerticalAlignMode(value: |
Gets or sets the vertical alignment to display the image. |
||
GetScrollBarVisible(): SetScrollBarVisible(value: |
Gets and sets the visibility of the scroll bars if the image width/height is greater than the control client area. |
||
GetScrollBarStyle(): SetScrollBarStyle(value: |
Gets and sets the scroll bars style used when the ScrollBarVisible property is set to True and the width or height of the image to be displayed is greater than the control client area. |
Expected input: |
|
GetTileWidth(): SetTileWidth(value: |
Gets and sets the tile width to divide the image according to. |
Expected input: |
|
GetTileHeight(): SetTileHeight(value: |
Gets and sets the tile height to divide the image according to. |
Expected input: |
|
GetResourcesPath(): SetResourcesPath(value: |
Gets and sets the virtual path to where resources(images, scripts) are located. |
Expected input: |
|
GetHorizontalRealScaleFactor(): |
Gets the real horizontal scale factor used to display the image. |
- | |
GetVerticalRealScaleFactor(): |
Gets the real vertical scale factor used to display the image. |
- | |
N/A | GetScrollInfo():ltwfScrollInfo Client Class | Gets information about the scroll bars like position of the scroll box, min and max scrolling value, and the size of the scroll box. | 0:horizontal scrollbar information, 1:vertical scrollbar information. |
ScrollPosition | ScrollTo(x: |
Scroll the image manually by changing the horizontal and vertical scroll box positions. | x: the new horizontal scrollbar thumb position, y:the new vertical scrollbar thumb position. |
N/A | Apply() | Apply all the options set by the user and update the viewable area. | - |
Client Public Events
All public client-side Leadtools events can be overridden with your own function. The following example displays a Javascript alert whenever the ImageUrl property is changed on the TiledImageViewer client object.
TiledImageViewer1.ImageUrlChanged = myImageUrlChanged;
function myImageUrlChanged()
{
alert("ImageUrl Changed!");
}
The following table lists the Client side events that can be overridden:
Event Name(Server) | Event Name(Client) | Raised when |
---|---|---|
InputProfileChanged |
InputProfile property is changed. |
|
OutputProfileChanged |
OutputProfile property is changed. |
|
ImageUrlChanged |
ImageUrl property is changed. |
|
ScaleFactorChanged |
ScaleFactor property is changed. |
|
SizeModeChanged |
SizeMode property is changed. |
|
HorizontalAlignModeChanged |
HorizontalAlignMode property is changed. |
|
VerticalAlignModeChanged |
VerticalAlignMode property is changed. |
|
ScrollBarVisibleChanged |
ScrollBarVisible property is changed. |
|
ScrollBarStyleChanged |
ScrollBarStyle property is changed. |
|
TileWidthChanged |
TileWidth property is changed. |
|
TileHeightChanged |
TileHeight property is changed. |
|
ResourcesPathChanged |
ResourcesPath property is changed. |