<HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="GENERATOR" CONTENT="Crafted by hand"> <TITLE>HELLO WORLD EXAMPLE 1 - USING EMBEDDED OBJECTS</TITLE>
<!-- JavaScript Include Files used for checking ECW Plug-in versioning --> <SCRIPT LANGUAGE=javascript src="/ecwplugins/lib/scripts/NCSConstants.js"></SCRIPT> <SCRIPT LANGUAGE=vbscript src="/ecwplugins/lib/scripts/NCSCheckActiveX.vbs"></SCRIPT> <SCRIPT LANGUAGE=javascript src="/ecwplugins/lib/scripts/NCSCheck.js"></SCRIPT> </HEAD> <!-- --- There are developer notes at the bottom of the code which you can refer to. --> <!-- See note 1 for discussion of onload events --> <BODY onload="onLoadCB();"> <FONT SIZE="2" FACE="Arial," COLOR="Black"> <p><B>HELLO WORLD BASIC - BASIC VIEW CONTROL WITH A TOOLBAR AND A PROGRESSBAR</B></p> <p>This example shows a simple control, which opens an image. A toolbar has been added that <br> provides the user with PAN / ZOOM / ZOOMBOX / POINTER / RESET EXTENTS buttons. <br> A progress bar below the image shows the percentage of image loading completed. </p> <HR> <!--See note 2 for discussion - code to add a toolbar control into the page --> <div align = left> <OBJECT classid="clsid:79E46020-ED4B-447A-B191-AD2A63AF51A1" codebase="/ecwplugins/ncs.cab#version=2,0,0,89" id="ECWToolBar1"> <EMBED type="application/x-ImageWebServer-toolbar" name="ECWToolBar1"> </OBJECT> </div> <!--See note 3 for discussion - code to add a layered view control into the page --> <div align = left> <OBJECT classid="clsid:D147430C-86CD-4E6F-A807-93FBC496D201" width=580 height=400 codebase="/ecwplugins/ncs.cab#version=2,0,0,89 " id="ECWView1" > <EMBED type="application/x-ImageWebServer2-ecw" width=580 height=400 name="ECWView1" pluginspage="/ecwplugins/DownloadNetscapePlugin.htm"> </OBJECT> </div> <!--See note 4 for discussion - code to add a progress bar into the page --> <div align = left> <OBJECT classid='clsid:584719E2-015C-438F-A012-0085270F8E63' codebase='/ecwplugins/ncs.cab#version=2,0,0,89 ' width=580 height=15 id='ECWProgressBar1'> <EMBED type='application/x-ImageWebServer-progressbar' width=580 height=16 id='ECWProgressBar1' name='ECWProgressBar1' pluginspage='/ecwplugins/DownloadNetscapePlugin.htm'> </OBJECT> </div> <HR><BR> </FONT> <script language="javascript"> /* --- See Note 4a for discussion of Version checking ------------ */ if (parseFloat(navigator.appVersion) < 4.0) { document.location = "/ecwplugins/sorry.htm"; } ECWCheckPlugin(); // call to function in NCSCheck.js Javascript Include File /*--See Note 5 for discussion - code to assign the image path to a variable name.*/ imageSRC1 = "ecwp://demo.ermapper.com/images/geodetic/world/landsat742.ecw"; // To experiment, substitute an image url of your own to load a different image. /*--See Note 1 for discussion - code to catch the onload event from the Body Tag.*/ function onLoadCB() { tOnLoadTimer = setTimeout("LoadHandler()", 500); } /*--See Note 6 below for discussion - code to load the ECW image into the LayeredView Control.*/ function LoadHandler() { if (document.ECWView1.AddLayer("ECW", imageSRC1, "RasterLayer1", "" ) < 0) { alert("Error adding ECW Layer' : \n\n" + document.ECWView1.GetLastErrorText()); } else { /*--See Note 7 for discussion - code to attach toolbar & the progressbar to the view */ document.ECWToolBar1.Attach(document.ECWView1.GetAttachPoint()); document.ECWProgressBar1.Attach(document.ECWView1.GetAttachPoint()); } }