I am using a the blackice tiff viewer in my asp page. Everything works great in IE, but does not work in Firefox.
Here is the body tag code
Script in head tag for the different features.
Here is the code in the page which will download the activeX if necessary.
The support for the activeX said it was only written and tested in IE. That I would need to do some editing to get this to work. Not really sure where to start of if anyone here could help point me in the right direction. Any help would be great.
Here is the body tag code
Code:
<body onload="javascript:OnLoad()">
Script in head tag for the different features.
Code:
<script language="JavaScript" type="text/javascript">
var PageNum=0;
var FilePath="<%=chrChartName%>";
var LocalFile="c:\\test.tif";
var zoom = .6;
var zoomRate = 0.1;
function OnScale(what)
{
switch(what.selectedIndex) {
case 0:
OnSWNormal();
break;
case 1:
OnSWdpi();
break;
case 2:
OnSWfitwidth();
break;
case 3:
OnSWfitheight();
break;
case 4:
OnSWfitwindow();
break;
}
}
function OnNext()
{
PageNum=PageNum+1;
var hDib = BITIFF.LoadTiffIntoDIB(LocalFile, PageNum, false);
BIDISP.hDib = hDib;
if(PageNum>0)
PreviousPage.style.visibility="visible";
if(PageNum>=BITIFF.GetNumberOfImagesInTiffFile(LocalFile)-1)
NextPage.style.visibility="hidden";
else
NextPage.style.visibility="visible";
}
function OnPrevious()
{
PageNum=PageNum-1;
var hDib = BITIFF.LoadTiffIntoDIB(LocalFile, PageNum, false);
BIDISP.hDib = hDib;
if(PageNum<=0)
PreviousPage.style.visibility="hidden";
else
PreviousPage.style.visibility="visible";
if(PageNum<BITIFF.GetNumberOfImagesInTiffFile(LocalFile)-1)
NextPage.style.visibility="visible";
}
function OnLoad()
{
BIDISP.ScaleMode = 1;
BIDISP.ScrollBars = 3;
BIDISP.ZoomWithKeyboard=0;
BIDISP.Zoom = 0;
// BIDISP.CustomZoom = -0.57;
BIDISP.CustomZoom(zoom);
BIDISP.Mapping = 1;
PreviousPage.style.visibility="hidden";
BITIFF.DownloadImageFileURL(FilePath, LocalFile);
}
function OnSWNormal()
{
BIDISP.ScaleMode = 1;
BIDISP.ZoomWithKeyboard=1;
BIDISP.Zoom = 1;
}
function OnSWdpi()
{
BIDISP.ScaleMode = 5;
BIDISP.ZoomWithKeyboard=1;
BIDISP.Zoom = 1;
}
function OnSWfitwidth()
{
BIDISP.ScaleMode = 2;
BIDISP.ZoomWithKeyboard=0;
BIDISP.Zoom = 0;
}
function OnSWfitheight()
{
BIDISP.ScaleMode = 3;
BIDISP.ZoomWithKeyboard=0;
BIDISP.Zoom = 0;
}
function OnSWfitwindow()
{
BIDISP.ScaleMode = 0;
BIDISP.ZoomWithKeyboard=0;
BIDISP.Zoom = 0;
}
function Onmagglasson()
{
if(magglasson.checked)
{
panning.style.visibility="hidden";
panningtext.style.visibility="hidden";
BIDISP.Magnify = 1;
BIDISP.ZoomWithKeyboard=0;
BIDISP.Zoom = 0;
}
else
{
panning.style.visibility="visible";
panningtext.style.visibility="visible";
BIDISP.Magnify = 0;
BIDISP.ZoomWithKeyboard=1;
BIDISP.Zoom = 1;
}
}
function OnPanning()
{
if(panning.checked)
{
BIDISP.Mapping = 1;
BIDISP.ZoomWithKeyboard=0;
BIDISP.Zoom = 0;
}
else
{
BIDISP.Mapping = 0;
BIDISP.ZoomWithKeyboard=0;
BIDISP.Zoom = 0;
}
}
function ZoomIn()
{
//BIDISP.ZoomIn();
zoom *= 1+zoomRate;
BIDISP.CustomZoom(zoom);
}
function ZoomOut()
{
//BIDISP.ZoomOut();
zoom *= 1/(1+zoomRate);
BIDISP.CustomZoom(zoom);
}
function FlipH()
{
var hDib = BIDIB.FlipDIBHorizontal(BIDISP.hDib);
BIDISP.hDib = hDib;
}
function FlipV()
{
var hDib = BIDIB.FlipDIBVertical(BIDISP.hDib);
BIDISP.hDib = hDib;
}
function Rotate90()
{
var hDib = BIDIB.RotateDIB270(BIDISP.hDib);
BIDISP.hDib = hDib;
}
function Rotate180()
{
var hDib = BIDIB.RotateDIB180(BIDISP.hDib);
BIDISP.hDib = hDib;
}
function Rotate270()
{
var hDib = BIDIB.RotateDIB90(BIDISP.hDib);
BIDISP.hDib = hDib;
}
function Invert()
{
if(BIDISP.Invert)
BIDISP.Invert=false;
else
BIDISP.Invert=true;
}
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>
Here is the code in the page which will download the activeX if necessary.
Code:
<object classid="clsid:1"><param name="LPKPath" value="tiff.LPK"></object>
<object id="BIDISP" width="100%" height="93%" classid="CLSID:1" codebase="tiff.cab"></object>
<object id="BITIFF" width=1 height=1 classid="CLSID:1" codebase="tiff.cab"></object>
<object id="BIDIB" width=1 height=1 classid="CLSID:1" codebase="tiff.cab"></object>
<script language="JavaScript" type="text/javascript">
function BITIFF::URLLoadImageComplete(DIB)
{
BIDISP.hDib = DIB;
}
function BITIFF::URLDownloadImageFileComplete()
{
var hDib = BITIFF.LoadTiffIntoDIB("c:\\test.tif", 0, false);
BIDISP.hDib = hDib;
}
</script>
The support for the activeX said it was only written and tested in IE. That I would need to do some editing to get this to work. Not really sure where to start of if anyone here could help point me in the right direction. Any help would be great.