田源
2024-04-07 2ac55ce0edf4870a29691b56bfad59f4830a11a2
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
draw2d.ResizeImage = function(_url) {
    this.url = _url;
    this.img = null;
    draw2d.Node.call(this);
    this.setDimension(100, 100);
    this.setColor(null);
};
draw2d.ResizeImage.prototype = new draw2d.Node;
draw2d.ResizeImage.prototype.type = "ResizeImage";
draw2d.ResizeImage.prototype.createHTMLElement = function() {
    var item = draw2d.Node.prototype.createHTMLElement.call(this);
    if (navigator.appName.toUpperCase() == "MICROSOFT INTERNET EXPLORER") {
        this.d = document.createElement("div");
        this.d.style.position = "absolute";
        this.d.style.left = "0px";
        this.d.style.top = "0px";
        this.d.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader (src='"
                + this.url + "', sizingMethod='scale')";
        item.appendChild(this.d);
    } else {
        this.img = document.createElement("img");
        this.img.style.position = "absolute";
        this.img.style.left = "0px";
        this.img.style.top = "0px";
        this.img.src = this.url;
        item.appendChild(this.img);
        this.d = document.createElement("div");
        this.d.style.position = "absolute";
        this.d.style.left = "0px";
        this.d.style.top = "0px";
        item.appendChild(this.d);
    }
    item.style.left = this.x + "px";
    item.style.top = this.y + "px";
    return item;
};
draw2d.ResizeImage.prototype.setDimension = function(w, h) {
    try{
        draw2d.Node.prototype.setDimension.call(this, w, h);
        if (this.d !== null) {
            this.d.style.width = this.width + "px";
            this.d.style.height = this.height + "px";
        }
        if (this.img !== null) {
            this.img.width = this.width;
            this.img.height = this.height;
        }
    }catch(e){
    }
};
draw2d.ResizeImage.prototype.setWorkflow = function(_4b06) {
    draw2d.Node.prototype.setWorkflow.call(this, _4b06);
};