Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.21
TiledImageViewer JavaScript Client Class

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:String)

Gets and sets the name of the input profile xml file containing the load options to be used in loading the image file.

String representing the name of the load options XML file.

OutputProfile

GetOutputProfile():string

SetOutputProfile(value:String)

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.

String 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:String)

Gets or sets the URL of the image to be displayed.

String representing the new URL to be displayed.

ScaleFactor

GetScaleFactor():Double

SetScaleFactor(value:Double)

Gets or sets The zoom factor used to display the image.

Double representing the zoom factor to be used in displaying the image

100 means displaying the image in original width/height (1:1).

SizeMode

GetSizeMode():Int32

SetSizeMode(value:Int32)

Gets or sets how the control displays the image and the automatic adjustments of the display rectangles.

Int32 (0-4), 0:Normal, 1:Stretch, 2:FitAlways, 3:FitWidth, 4: Fit.

HorizontalAlignMode

GetHorizontalAlignMode():Int32

SetHorizontalAlignMode(value:Int32)

Gets or sets the horizontal alignment to display the image.

Int32 (0-2), 0:Near, 1:Center, 2:Far.

VerticalAlignMode

GetVerticalAlignMode():Int32

SetVerticalAlignMode(value:Int32)

Gets or sets the vertical alignment to display the image.

Int32 (0-2), 0:Near, 1:Center, 2:Far.

ScrollBarVisible

GetScrollBarVisible():Boolean

SetScrollBarVisible(value:Boolean)

Gets and sets the visibility of the scroll bars if the image width/height is greater than the control client area.

Boolean representing visibility of the scroll bars, true: Show scroll bars; False: hide scroll bars.

ScrollBarStyle

GetScrollBarStyle():Int32

SetScrollBarStyle(value:Int32)

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: Int32 (0-3), 0:Classic, 1:Xp, 2:CustomClassic, 3:CustomXp.

TileWidth

GetTileWidth():Int32

SetTileWidth(value:Int32)

Gets and sets the tile width to divide the image according to.

Expected input: Int32 representing the tile width to divide the image accoding to, 0 means consider the image width as one tile.

TileHeight

GetTileHeight():Int32

SetTileHeight(value:Int32)

Gets and sets the tile height to divide the image according to.

Expected input: Int32 representing the tile height to divide the image accoding to, 0 means consider the image height as one tile.

ResourcesPath

GetResourcesPath():String

SetResourcesPath(value:String)

Gets and sets the virtual path to where resources(images, scripts) are located.

Expected input: String representing the virtual path to where resources(images, scripts) are located.

HorizontalRealScaleFactor

GetHorizontalRealScaleFactor():Double

Gets the real horizontal scale factor used to display the image.

-

VerticalRealScaleFactor

GetVerticalRealScaleFactor():Double

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:Int32, y: Int32) 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

InputProfileChanged

InputProfile property is changed.

OutputProfileChanged

OutputProfileChanged

OutputProfile property is changed.

ImageUrlChanged

ImageUrlChanged

ImageUrl property is changed.

ScaleFactorChanged

ScaleFactorChanged

ScaleFactor property is changed.

SizeModeChanged

SizeModeChanged

SizeMode property is changed.

HorizontalAlignModeChanged

HorizontalAlignModeChanged

HorizontalAlignMode property is changed.

VerticalAlignModeChanged

VerticalAlignModeChanged

VerticalAlignMode property is changed.

ScrollBarVisibleChanged

ScrollBarVisibleChanged

ScrollBarVisible property is changed.

ScrollBarStyleChanged

ScrollBarStyleChanged

ScrollBarStyle property is changed.

TileWidthChanged

TileWidthChanged

TileWidth property is changed.

TileHeightChanged

TileHeightChanged

TileHeight property is changed.

ResourcesPathChanged

ResourcesPathChanged

ResourcesPath property is changed.