Using a PanWindow (JavaScript)
Take the following steps to add a Pan Window to your page:
1. |
Start with the project that you created in Loading and Displaying an Image. |
2. |
Add the following code between the <FORM> </FORM> tags to add the button btnPanWnd: |
<INPUT TYPE="button" NAME="btnPanWnd" VALUE="Pan Window" LANGUAGE="JavaScript"
OnClick="PanWnd()">
3. |
Delete the following line from the Window_OnLoad function: |
Lead1.PaintSizeMode = PAINTSIZEMODE_FIT;
4. |
Add the following code between the <SCRIPT> </SCRIPT> tags for the btnPanWnd button: |
function PanWnd()
{
LEADRasterView1.BackErase = false;
//set the location of the PanWindow
LEADRasterView1.PanWinX = 100;
LEADRasterView1.PanWinY = 100;
//set the size of the PanWindow
//requested width
LEADRasterView1.PanWinWidth = 150;
//requested height
LEADRasterView1.PanWinHeight = 200;
LEADRasterView1.PanWinTitle = "PanWindow";
LEADRasterView1.PanWinRectColor = 255; //Red
LEADRasterView1.PanWinSysMenu = true;
//use the settings for LEADRasterView1
LEADRasterView1.PanWinPaintPalette = LEADRasterView1.PaintPalette;
LEADRasterView1.PanWinBitonalScaling = LEADRasterView1.BitonalScaling;
LEADRasterView1.PanWinPaintScaling = LEADRasterView1.PaintScaling;
LEADRasterView1.PanWinPaintDither = LEADRasterView1.PaintDither;
//show the Pan Window
LEADRasterView1.ShowPanWin (true);
}
5. |
Run your page to test it. |