Display an Image on the Web

You can download an image from a Web server to the local machine, and display it. You have to use the BiDisp and BiTiff controls.

 

[JavaScript]

 

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>

<HTML>

<HEAD>

<TITLE> Using Black Ice ActivwX control with HTML form tag </TITLE>

<SCRIPT language="JavaScript">

            var PageNum=0;

            var FilePath="http://www.blackice.com/DOCIMG_HTML_SAMPLE/test.tif";

            var LocalFile="c:\\test.tif";

 

            function OnLoad()

            {

                        BIDISP.ScaleMode = 5;

                        BIDISP.ScrollBars = 3;

                        BIDISP.ZoomWithKeyboard=1;

                        BIDISP.Zoom = 0;

                        BITIFF.DownloadImageFileURL(FilePath, LocalFile);

            }

 

            function MM_reloadPage(init)

            {  //reloads the window if Nav4 resized

              if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

                        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

              else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

            }

            MM_reloadPage(true);

 

</SCRIPT>

</HEAD>

 

<BODY>

<P align="center"><strong><font size="+3">Using Black Ice OCX control with HTML FORM tag</font></strong>

</P>

 

<P>

            <TABLE width="645" height="372" border="1" align="center">

              <TR>

                        <TD width="100%" colspan="2" rowspan="3">

                       

                          <object id="BIDISP" width="100%" height="100%" classid="CLSID:19B50C95-6BB5-4DFD-B20C-5B9A61FA1C0D" CODEBASE="http://www.blackice.com/DOCIMG_HTML_SAMPLE/tiff.cab">

                          </object>      

                         

                          <object id="BITIFF" width=1 height=1 classid="CLSID:2324B5B7-D3EF-464C-BB35-06EFF8F11EB3" CODEBASE="http://www.blackice.com/DOCIMG_HTML_SAMPLE/tiff.cab">

                          </object>

                         

                          <SCRIPT>

                                    function BITIFF::URLDownloadImageFileComplete()

                                    {

                                                var hDib = BITIFF.LoadTiffIntoDIB(LocalFile, 0, false);

                                                BIDISP.hDib = hDib;

                                    }

                         </SCRIPT>

                        </TD>

                        </TR>

            </TABLE>

</P>

 

<P>

            <FORM>

                        <input type="button" value="Dispay Image" onClick="OnLoad()">

            </FORM>

</P>

 

</BODY>

</HTML>