2
schangxiang@126.com
2024-08-16 b47c50a2a514def7374b32d7194b2c599cba5625
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
 
function MiaovDraw(w, h, parent)
{
    var bIsIE=(/ie/i).test(window.navigator.userAgent);
 
    this.width= w;
    this.height= h;
    var tmp = 0;
    var browser=navigator.appName;
    var b_version=navigator.appVersion;
    var version=b_version.split(";");
    var trim_Version = "";
    if (version.length>1) {
        var trim_Version=version[1].replace(/[ ]/g,"");
    }
 
 
 
    //alert(browser +  "  " + trim_Version);
    bIsIE = browser=="Microsoft Internet Explorer" && (trim_Version=="MSIE7.0" || trim_Version=="MSIE8.0");
    if(bIsIE)
    //if(browser=="Microsoft Internet Explorer" && (trim_Version=="MSIE7.0" || trim_Version=="MSIE8.0"))
    {
        //document.namespaces.add("mv","urn:schemas-microsoft-com:vml");
        //document.createStyleSheet().addRule(".mv", "behavior:url(#default#VML)");
 
        this.container=document.createElement('<mv:group class="mv">');
 
        this.container.style.position='absolute';
        this.container.style.width=w+'px';
        this.container.style.height=h+'px';
 
        this.container.coordsize=w+','+h;
 
        this.container.style.left='0px';
        this.container.style.top='0px';
 
        parent.appendChild(this.container);
 
        this.reappend=function ()
        {
            parent.appendChild(this.container);
        };
    }
    else
    {
        var canvas=document.createElement('canvas');
        canvas.style.position='absolute';
        canvas.width=w;
        canvas.height=h;
        canvas.innerHTML='你的浏览器不支持canvas,访问<a href="http://www.16sucai.com/">这里</a>了解更多';
 
        canvas.style.left='0px';
        canvas.style.top='0px';
 
        parent.appendChild(canvas);
 
        this.reappend=function ()
        {
            parent.appendChild(canvas);
        };
 
        this.container=canvas.getContext('2d');
        this.container.strokeStyle='#00CC00';
        //window.setInterval(function(){
        //    if(tmp==0){
        //        console.info("111");
        //        this.container.strokeStyle='#00CC00';
        //        tmp = 1;
        //        console.info(tmp);
        //    }else{
        //        this.container.strokeStyle='#e11408';
        //        console.info("222");
        //        tmp = 0;
        //    }
        //
        //},1000);
 
 
 
        //this.container.strokeStyle='#e11408';
    }
 
    var sFn="line|clear";
    var arr=sFn.split('|');
 
    for(var i=0;i<arr.length;i++)
    {
        this[arr[i]]=this[(bIsIE?'IE':'DOM')+'_'+arr[i]];
    }
}
 
MiaovDraw.prototype.IE_line=function (x1, y1, x2, y2)
{
 
 
 
    var l=document.createElement('<mv:line class="mv">');
 
    l.from=x1+','+y1;
    l.to=x2+','+y2;
    l.strokeColor='#00CC00';
 
    if(this.lineWidth)l.StrokeWeight=this.lineWidth;
    if(this.strokeColor)l.StrokeColor=this.strokeColor;
 
 
 
    this.container.appendChild(l);
 
    //alert(l.from+'->'+l.to);
};
 
MiaovDraw.prototype.DOM_line=function (x1, y1, x2, y2)
{
    this.container.setLineDash([5,10]);
    this.container.lineWidth = 2;
    this.container.moveTo(x1,y1);
    this.container.lineTo(x2,y2);
 
    //document.title=x1+','+y1+'\t'+x2+','+y2;
 
    this.container.stroke();
};
 
MiaovDraw.prototype.xx=function (x1, y1, x2, y2)
{
    this.container.setLineDash([5,5]);
    this.container.moveTo(x1,y1);
    this.container.lineTo(x2,y2);
 
    //document.title=x1+','+y1+'\t'+x2+','+y2;
 
    this.container.stroke();
};
 
MiaovDraw.prototype.IE_clear=function ()
{
    var i=0;
 
    for(i=this.container.childNodes.length-1;i>=0;i--)
    {
        this.container.removeChild(this.container.childNodes[i]);
    }
};
 
MiaovDraw.prototype.DOM_clear=function ()
{
    this.container.clearRect(0,0,this.width,this.height);
};