forked from altert/OpenSeadragonCanvasOverlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
executable file
·77 lines (66 loc) · 2.38 KB
/
demo.html
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
<!DOCTYPE html>
<html>
<head>
<title>OpenSeadragon Canvas Overlay Demo</title>
<script src="openseadragon/openseadragon.js"></script>
<script src="openseadragon-canvas-overlay.js"></script>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<style type="text/css">
html,
body,
.openseadragon1 {
width: 100%;
height: 100%;
margin: 0;
}
</style>
<script>
// ----------
App = {
// ----------
init: function() {
var self = this;
var tileSource = {
Image: {
xmlns: "http://schemas.microsoft.com/deepzoom/2008",
Url: "http://openseadragon.github.io/example-images/highsmith/highsmith_files/",
Format: "jpg",
Overlap: "2",
TileSize: "256",
Size: {
Height: "9221",
Width: "7026"
}
}
};
this.viewer = OpenSeadragon({
id: "contentDiv",
prefixUrl: "openseadragon/images/",
tileSources: [{
tileSource: tileSource,
width: 2,
y: 0,
x: 0
}]
});
var overlay = this.viewer.canvasOverlay({
onRedraw:function() {
overlay.context2d().fillStyle = "red";
overlay.context2d().fillRect(0, 0, 500, 500);
}
});
$(window).resize(function() {
overlay.resize();
});
}
};
// ----------
$(document).ready(function() {
App.init();
});
</script>
</head>
<body>
<div id="contentDiv" class="openseadragon1"></div>
</body>
</html>