Updating a Gauge and Detecting a User Interrupt (JavaScript)
1. |
Start with the project that you created in Loading and Displaying an Image. |
2. |
Add the following code between the <BODY> </BODY> tags to add a LEAD Raster Process object named RasterProc: |
<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>
3. |
Add the following code between the <BODY> </BODY> tags to add a Microsoft ProgressBar object named ProgressBar1: |
<OBJECT id=ProgressBar1
style="WIDTH: 667px; HEIGHT: 31px; BACKGROUND-COLOR: white"
classid=clsid:0714E8D2-850A-101B-AFC0-4210102A8DA7 VIEWASTEXT>
</OBJECT>
4. |
Add the following code between the <FORM> </FORM> tags to create a command button named btnMedian: |
<INPUT TYPE="button" NAME="btnMedian" VALUE="Median" LANGUAGE="JavaScript" OnClick="Median()">
5. |
Add the following code between the <SCRIPT> </SCRIPT> tags: |
function Median()
{
RasterProc.EnableProgressEvent = true;
RasterProc.Median (LEADRasterView1.Raster, 4);
LEADRasterView1.ForceRepaint ();
}
6. |
Add the following code between the <HEAD> </HEAD> tags to handle the ProgressStatus event: |
<SCRIPT LANGUAGE="JavaScript" FOR="RasterProc" EVENT="ProgressStatus(iPercent)">
<!--
ProgressBar1.Value = iPercent;
//-->
</SCRIPT>
7. |
Run your page to test it. |