ASP Example

Your Web Server must support Active Server Pages to use this feature. Some Web Servers that currently support ASP:

image\sqrblit.gif Microsoft Personal Web Server

image\sqrblit.gif Microsoft Internet Information Server (IIS)

image\sqrblit.gif Microsoft Peer Web Services (IIS for Windows NT Workstation 4.0)

You must have the LEAD license file on the server, in the same directory as the LEAD ActiveX file. In version 12, the license file is named LTOCX14.LIC. If Document/Medical features are required (i.e. ScaleToGray, Despeckle, Deskew, etc), you must obtain the appropriate license file from LEAD Technologies, Inc. (704-372-9681).

An instance of the LEAD COM Objects is created on the server using CreateObject method (three of LEAD COM Objects are used in this demo). CreateObject has the required argument "class" which is either the ClassID or the ProgID of the ActiveX component. This can be done one of two ways:

1.

Set Raster  

= Server.CreateObject("LEADRaster.LEADRaster.145")

Set RasterProc  

= Server.CreateObject("LEADRasterProcess.LEADRasterProcess.145")

Set RasterIO  

= Server.CreateObject("LEADRasterIO.LEADRasterIO.145")

 

2.

Set Raster  

= Server.CreateObject("00120700-B1BA-11CE-ABC6-F5B2E79D9E3F")

Set RasterProc  

= Server.CreateObject("00120712-B1BA-11CE-ABC6-F5B2E79D9E3F")

Set RasterIO  

= Server.CreateObject("0012070E-B1BA-11CE-ABC6-F5B2E79D9E3F")

View the LEAD ASP demo by going to "http://www.leadtools.com" and clicking on the "Download Demos"

To install the ASP Lead demo on your web server, you must install and register the mentioned LEAD COM Objects on the web server. For a list of files that are necessary, see the Files To Be Included With Your Application. Next, copy the file demo.asp to the desired location on your web server. The location must be accessible through a client browser.

Open demo.asp in an editor, and change the two variables IMAGE_FOLDER, UPLOAD_FOLDER to map to directories on your web server. These directories must exist on your web server. If they do not exist, you must create the directories.

Change the two variables COM_IMAGE_FOLDER, COM_UPLOAD_FOLDER to have same values as IMAGE_FOLDER, UPLOAD_FOLDER respectively and replacing the single back slash "\" with a double back slash "\\".

Change the variables LOGO_IMAGE have the server path to a logo image used to be displayed to users each time they start the demo.

The following .cmp images must be present on the server under the path indicated by the variables IMAGE_FOLDER and COM_IMAGE_FOLDER:

Flowers.cmp , TeddyBear.cmp, NightLights.cmp, Santa.cmp, Turtle.cmp, Car.cmp, Faces.cmp, Cake.cmp, Athlete.cmp, Field.cmp

After installing your LEAD toolkit, copy all the *.cmp files from the LEAD\images folder to the This location, and rename files.

COM_UPLOAD_FOLDER and UPLOAD_FOLDER variables indicate the location used for temporary uploaded image files that are uploaded by users.

In the demo.asp demo, every action (i.e. "flip") generates a temp image that replaces the current image. HTML is generated to display this image, and this is sent to the client. This will work under Internet Explorer, but fail to work under certain versions of Netscape 4.0 because of a problem with caching images. The result is that once certain versions of Netscape 4.0 cache an image file, it always accesses the cached image instead of reloading from the server.

Modify the "global.asa" file on your webserver to initalize variables required by the demo. An example "global.asa" file is shown below.

 

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
SUB Application_OnStart
END SUB
</SCRIPT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
SUB Application_OnEnd
END SUB
</SCRIPT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
SUB Session_OnStart
Session("SelectedValue")= ""
Session("Start")= "true"
Session("CurAction")= ""
Session("Finish")= "false"
Session("ServerImage")=""
Session("Upload")="false"
END SUB
</SCRIPT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
SUB Session_OnEnd
Session("Finish")= "true"
END SUB
</SCRIPT>