1
Surpriseplus
2022-10-14 6d536dea3cec157947947aa075bebde4305f29b9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9" />
    <title>3D View Comparison</title>
<script type="text/javascript" src="range.js"></script>
<script type="text/javascript" src="timer.js"></script>
<script type="text/javascript" src="slider.js"></script>      
<script language="javascript" src="../ToolsCommon65.js"></script>
<link type="text/css" rel="StyleSheet" href="slider.css" />  
 
<link type="text/css" rel="StyleSheet" href="../Style.css" />
 <style>
        .directionSelect
        {width: 80px; color:White; background-color:#535353;   border: 2px double white;}
    </style>
 
     <object id="SGWorld" classid="CLSID:3a4f9197-65a8-11d5-85c1-0001023952c1">
    </object>
<script language="jscript" type="text/javascript">
 
var snapshotAImg;
var snapshotBImg;
var sliderClip;
var lastlevelClip = 0;
var lastleveltran = 0;
var ImageryLayerObj;
var ImageryLayerGeometry;
var ClipAutoOnOff = false;
var Cliptimeout;
 
//--------------
// Init
function Init() {
 
    try {
 
        snapshotAImg = decodeURI(GetParamValue("A", ""));
        snapshotAImg = snapshotAImg.replace("#", ".");
 
        if (snapshotAImg == "")
        {
            alert (SGLang.i18n("Text3") );
            return;
        }
 
        CaptureB();
 
        document.getElementById("SnapshotA").src = snapshotAImg;
        document.getElementById("SnapshotB").src = snapshotBImg;
 
        sliderClip = new Slider(document.getElementById("sliderClip"), document.getElementById("sliderClipID"));
        sliderClip.setValue(100);
        sliderClip.setMinimum(0);
        sliderClip.setMaximum(100);
        sliderClip.onchange = function () {
            SetClipTrans(sliderClip.getValue());
        };
 
 
    }
    catch (e) { alert(SGLang.i18n("Text13") + e.message); }
    
    document.getElementById("mainTblID").style.visibility = "visible";
    SGWorld.Window.RemovePopupByCaption(SGLang.i18n("Text6"));
 
}
 
 
//--------------
// CaptureB
function CaptureB() {
    try {
        var ratio = SGWorld.Window.Rect.Width / SGWorld.Window.Rect.Height;
        var width = Math.min(SGWorld.Window.Rect.Width, 1499);
        var height = Math.min(width / ratio, 1499);
        snapshotBImg = SGWorld.Window.GetSnapShot(true, width, height, "JPeg75", 0);
    }
    catch (err) {alert (err);}
 
}
 
//--------------
// SetTransparency
function SetTransparency(level) {
    try {
        var imgB = document.getElementById("SnapshotB").style;
        imgB.opacity = (level / 100.0);
        imgB.MozOpacity = (level / 100.0);
        imgB.KhtmlOpacity = (level / 100.0);
        imgB.filter = 'alpha(opacity=' + level + ')';
 
        // document.getElementById("SnapshotA").style.filters.alpha.opacity = level ;
    //    filter: alpha(opacity = 40); 
 
 
    //    ImageryLayerObj.FillStyle.Color.SetAlpha(level / 100.0);
        document.getElementById("clipSpan").innerHTML = level + "%";
    }
    catch (e) { alert(SGLang.i18n("Text3") + e.message); }
}
 
//--------------
// SetClip
function SetClip(level) {
 
    var imgB = document.getElementById("SnapshotB");
    var divB = document.getElementById("snapshotBDiv").style;
 
    divB.left = 5 + "px";
    divB.top = 40 + "px";
    divB.height = imgB.clientHeight + "px";
    divB.width = imgB.clientWidth + "px";
    imgB.style.marginLeft = 0;
    imgB.style.marginTop = 0;
 
    if (document.getElementById("clipDirectionID").value == "0") {
        divB.width = imgB.clientWidth * level / 100.0 + "px";
    }
    if (document.getElementById("clipDirectionID").value == "1") {
        divB.width = imgB.clientWidth * level / 100.0 + "px";
        var offset = imgB.clientWidth - imgB.clientWidth * level / 100.0;
        divB.left = offset + 5 + "px";
        imgB.style.marginLeft = -offset + "px";
    }
    if (document.getElementById("clipDirectionID").value == "2") {
        divB.height = imgB.clientHeight * level / 100.0 + "px";
        var offset = imgB.clientHeight - imgB.clientHeight * level / 100.0;
        divB.top = offset + 40 + "px";
        imgB.style.marginTop = -offset + "px";
    }
    if (document.getElementById("clipDirectionID").value == "3") {
        divB.height = Math.max(1, imgB.clientHeight * level / 100.0) + "px";
    }
 
    document.getElementById("clipSpan").innerHTML = level + "%";
 
}
 
//--------------
// SetClipTrans
function SetClipTrans(level) {
 
    if (document.getElementById("clipDirectionID").value == "4") {   // Transparency
        SetClip(100);
        SetTransparency(level);
        return;
    }
    else {    // Clipping
        SetTransparency(100);
        SetClip(level);
    }
}
//--------------
// DynamicCompare
function DynamicCompare() {
 
 
    var url = abspath() + "/ImageComparisonPopup.html";
    var popupMsg = SGWorld.Creator.CreatePopupMessage(SGLang.i18n("Text15"), url, 0, 5, 480, 120, -1);
 
    popupMsg.Flags = 2 + 64 + 128 + 2048;
    SGWorld.Window.ShowPopup(popupMsg);
 
    exitTool();
}
 
 
//--------------
// exitTool
function exitTool() {
    SGWorld.Window.RemovePopupByCaption(SGLang.i18n("Text31"));
    SGWorld.Window.RemovePopupByCaption(SGLang.i18n("Text16"));
}
    
</script>           
        
</head>
<body onload="Init();" onunload="exitTool();"  style="overflow:hidden; border: 0;background-color: #535353" leftmargin='2' topmargin="5" marginwidth="0" marginheight="0"  >  <!-- oncontextmenu="return false;">-->
     <table id="mainTblID" cellpadding ="0" cellspacing = "1" border="0" style="visibility:_hidden;" >
                   
                     <tr style="color:White">
                        <td style="width:120px;color:White" ><span class="i18n" >Text22</span>
                            <select class="directionSelect" style="vertical-align:middle" id="clipDirectionID" onchange="SetClipTrans(sliderClip.getValue());">
                                <option value="0" class="i18n">Text23</option>
                                <option value="1" class="i18n">Text24</option>
                                <option value="2" class="i18n">Text25</option>
                                <option value="3" class="i18n">Text26</option>
                                <option value="4" class="i18n">Text21</option>
                            </select>
                        </td>
                        <td  style="width:270px" ><span id="sliderClip" style="display:inline-block"><input type="text" id="sliderClipID" /></span> <span id="clipSpan" style="color:White">100%</span></td>
                       <!-- <td style="color:White; text-decoration:underline;"><span class="i18n" onclick="DynamicCompare();" style="cursor:pointer;">Text30</span></td>-->
                     </tr>
                     <tr>
                     <td colspan="4">
                        <div id="snapshotADiv" style="position:absolute; left:5px; top:40px; overflow:hidden"><img id="SnapshotA" src="" alt="snapshot A" /></div>
                        <div id="snapshotBDiv" style="position:absolute; left:5px; top:40px; overflow:hidden"><img id="SnapshotB" src="" alt="snapshot B" /></div>
                     </td>
                     </tr>
                     </table>
 
 
</body>
</html>
 
 
<!--Sig:00000040Bxo14MswWmd5#dbo.9e0QpzNiuSShkjDTXx9GFOLkGlsk9p4rbijxY4XW.4uE7H3nAG8ilW9jOb95FJ4aZWUGDJJ-->