The main class for the web server version of the PanWindow Control.

For a list of all members of this type, see PanWindow Members.

System.Object
  System.Web.UI.Control
    System.Web.UI.WebControls.WebControl
          Newtone.ImageKit.Web

public class PanWindow : Object

Explanation

The ImageKit.Web.PanWindow Control is used in conjuction with the ImageKit.Web.ImageKit Control. The PanWindow control is a web server control that displays an entire image when only a portion of that image is displayed in the ImageKit control. Moving the view finder in the PanWindow control scrolls the image in the ImageKit control.

To scroll an image using the PanWindow control, click the control. The image in the ImageKit control will automatically be centered at the mouse click location. The view finder in the PanWindow control can now be moved with the mouse. By moving the view finder with the mouse, the image displayed within the ImageKit control is scrolled. To stop the scrolling action and release the view finder in the PanWindow, click the PanWindow control again. The view finder will be released by the mouse and scrolling stops.

To use the PanWindow the following conditions must be met:
1. The ImageKit control must be displaying an image and the control's DisplayMode property must be set to ActualSize.
2. The ImageKit Control and PanWindow Control must be linked using their Link properties as follows: ImageKit1.Link = PanWindow1.Link
3. The JavaScript function called enablePanWindow should be executed in the web page. This function adds the necessary mouse and scroll events so the ImageKit and PanWindow controls can work together in the client browser.

Sample code to load and display an image

[Visual Basic.NET]
ImageKit1.Url = "abc.tif"
ImageKit1.LoadImageFromFile(Newtone.ImageKit.LoadFileType.Load)
ImageKit1.ScrollBars = True
ImageKit1.Display(Newtone.ImageKit.Web.DisplayMode.ActualSize)
ImageKit1.Link = PanWindow1.Link
ImageKit1.ShowPanWindow()
            
[C#]
ImageKit1.Url = "abc.tif";
ImageKit1.LoadImageFromFile(Newtone.ImageKit.LoadFileType.Load);
ImageKit1.ScrollBars = true;
ImageKit1.Display(Newtone.ImageKit.Web.DisplayMode.ActualSize);
ImageKit1.Link = PanWindow1.Link;
ImageKit1.ShowPanWindow();
            

Then in the html page, execute the enablePanWindow. In the code below, we are using the onload event of the body tag.

 <body onload = "enablePanWindow('ImageKit1', 'PanWindow1');">
            

Note:
Some browsers will not correctly display the PanWindow under the following conditions:
1. When the ImageKit Control's ScrollBars property is set to False
2. When the size of the viewer in the PanWindow is less than 20 X 20 pixels. (The size of the viewer is determined by the relationship between the size of the PanWindow Control, the size of the ImageKit Control, and the size of the image being displayed)
3. When the height and width values for the ImageKit control and the PanWindow control are written in the Style statement. To be sure the controls function properly, write the height and width values for the controls in older html 3.0 format as in the underlined code below. The same height and width values may also be written within the Style statement.

 <cc1:ImageKit ID="ImageKit1" runat="server" Height="600px" Width="600px" Style="left: 229px;
       position: absolute; top: 21px"  UseJavaScriptFile="True" />
<cc1:PanWindow ID="PanWindow1" runat="server" Height="150px" Width="150px" Style="left: 33px;
      position: absolute; top: 27px"  ViewerBorderColor="Yellow" />
                

If the UseJavaScriptFile property is true, be sure that the link to the ImageKitNet3.js file is correct.

Requirements

Namespace : Newtone.ImageKit.Web

Assembly : Newtone.ImageKit.Web.ImageKit.dll

See Also

PanWindow Members

The ImageKit WPF is created by Newtone Corporation