function createQRImage(e, t, n) {
	function k(e) {
		var t, n, r, i;
		t = "";
		r = e.length;
		for (n = 0; n < r; n++) {
			i = e.charCodeAt(n);
			if (i >= 1 && i <= 127) {
				t += e.charAt(n)
			} else if (i > 2047) {
				t += String.fromCharCode(224 | i >> 12 & 15);
				t += String.fromCharCode(128 | i >> 6 & 63);
				t += String.fromCharCode(128 | i >> 0 & 63)
			} else {
				t += String.fromCharCode(192 | i >> 6 & 31);
				t += String.fromCharCode(128 | i >> 0 & 63)
			}
		}
		return t
	}
	n = n ? n : S;
	var s = {
		text: weburl+webroot,
		level: "L",
		width: 300,
		margin: 10,
		round: 0,
		isWater: false,
		bgColor: "#fff",
		fgColor: "#000",
		inptColor: null,
		ptColor: null,
		gcColor: null,
		gradientWay: "0",
		background: null,
		foreground: null,
		logoimg: null,
		logoType: "border",
		pinType: 0,
		paintColor: "#f00",
		fontEffect: "default",
		fontSize: 28,
		ftColor: null,
		content: null,
		rotate: 0
	};
	var o = $.extend({}, s, t);
	var u = this;
	var a = document.getElementById(e);
	var f = null;
	var l = 0;
	var c = [];
	var h = {};
	var p = 0;
	var d = null;
	var v = 300;
	var m = {
		pin: null
	};
	var g = 0;
	var y = false;
	var b = false;
	var w = false;
	var E = false;
	this.drawImage = function(e) {
		e = e || S;
		var t = a.getContext("2d");
		a.width = a.height = o.width;
		t.fillStyle = o.bgColor;
		t.fillRect(0, 0, o.width, o.width);
		if (o.background != null) {
			var n = o.background.width;
			var r = o.background.height;
			if (n > 0) {
				for (var i = 0; i < o.width; i += n) {
					for (var u = 0; u < o.width; u += r) {
						t.drawImage(o.background, i, u, n, r)
					}
				}
			}
		}
		var p = "";
		var v = f.length;
		l = (o.width - o.margin * 2) / v;
		var m = o.width / 2;
		j(t);
		if (o.gcColor) {
			d = D(t, o.fgColor, m)
		}
		for (var g = 0; g < v; g++) {
			for (var y = 0; y < v; y++) {
				if (C(g, y)) {
					if (o.pinType != 0 && L(g, y, v)) {
						continue
					}
					if (c[g][y]) {
						p = o.paintColor
					} else if (o.ptColor || o.inptColor && L(g, y, v)) {
						p = P(g, y, v)
					} else {
						p = o.fgColor
					}
					if (o.gcColor != null && !((o.ptColor || o.inptColor) && L(g, y, v))) {
						p = d
					}
					t.fillStyle = p;
					t.strokeStyle = p;
					var b = y * l + o.margin;
					var w = g * l + o.margin + l / 2;
					t.beginPath();
					t.moveTo(b, w);
					if (o.isWater) {
						if (C(g, y - 1) || C(g - 1, y) || C(g - 1, y - 1)) {
							O(t, y, g, 0)
						} else {
							M(t, y, g, 0)
						}
						if (C(g - 1, y) || C(g, y + 1) || C(g - 1, y + 1)) {
							O(t, y, g, 1)
						} else {
							M(t, y, g, 1)
						}
						if (C(g + 1, y) || C(g, y + 1) || C(g + 1, y + 1)) {
							O(t, y, g, 2)
						} else {
							M(t, y, g, 2)
						}
						if (C(g + 1, y) || C(g, y - 1) || C(g + 1, y - 1)) {
							O(t, y, g, 3)
						} else {
							M(t, y, g, 3)
						}
					} else {
						M(t, y, g, 0);
						M(t, y, g, 1);
						M(t, y, g, 2);
						M(t, y, g, 3)
					}
					t.closePath();
					if (o.foreground != null) {
						A(t)
					} else {
						t.fill();
						t.stroke()
					}
				} else if (o.isWater) {
					if (c[g][y]) {
						p = o.paintColor
					} else if (o.ptColor || o.inptColor) {
						p = P(g, y, v)
					} else {
						p = o.fgColor
					}
					if (!L(g, y, v)) {
						if (C(g - 1, y) && C(g, y - 1)) {
							_(t, y, g, 0, p)
						}
						if (C(g + 1, y) && C(g, y - 1)) {
							_(t, y, g, 3, p)
						}
						if (C(g + 1, y) && C(g, y + 1)) {
							_(t, y, g, 2, p)
						}
						if (C(g - 1, y) && C(g, y + 1)) {
							_(t, y, g, 1, p)
						}
					}
				}
			}
		}
		t.restore();
		for (var g = 0; g < o.rotate; g++) {
			W(t, 0, 0, o.width, o.width)
		}
		if (o.logoimg != null && o.level != "L") {
			var E = o.width / s.width;
			switch (o.logoType) {
			case "icon":
				I(t, o.logoimg, 3 * E, h.left * E, h.top * E, h.width * E, h.height * E);
				break;
			case "border":
				R(t, o.logoimg, 3 * E, h.left * E, h.top * E, h.width * E, h.height * E);
				break;
			case "stroke":
				U(t, o.logoimg, 3 * E, h.left * E, h.top * E, h.width * E, h.height * E);
				break;
			default:
				t.drawImage(o.logoimg, h.left * E, h.top * E, h.width * E, h.height * E)
			}
		}
		z(t);
		e()
	};
	this.changeContent = function(e, t) {
		t = t ? t : this.nullFn;
		o.content = e;
		this.drawImage()
	};
	this.changeText = function(e, t) {
		t = t ? t : this.nullFn;
		o.text = e;
		N(t)
	};
	this.changeLevel = function(e) {
		o.level = e;
		N()
	};
	this.changeBgColor = function(e) {
		o.background = null;
		o.bgColor = e;
		this.drawImage()
	};
	this.changeFgColor = function(e) {
		o.foreground = null;
		o.fgColor = e;
		this.drawImage()
	};
	this.changePtColor = function(e) {
		o.foreground = null;
		o.ptColor = e;
		this.drawImage()
	};
	this.changeInPtColor = function(e) {
		o.foreground = null;
		o.inptColor = e;
		this.drawImage()
	};
	this.changeGcColor = function(e, t) {
		o.foreground = null;
		o.gradientWay = e;
		o.gcColor = t;
		this.drawImage()
	};
	this.changeGradientWay = function(e, t) {
		o.foreground = null;
		o.gradientWay = e;
		o.gcColor = t;
		this.drawImage()
	};
	this.changeBackground = function(e) {
		T(e, "background")
	};
	this.changeForeground = function(e) {
		T(e, "foreground")
	};
	this.changeLogoimg = function(e, t) {
		o.logoType = t;
		o.level = "H";
		T(e, "logoimg")
	};
	this.changeLogotype = function(e) {
		o.logoType = e;
		this.drawImage()
	};
	this.changeFtColor = function(e) {
		o.ftColor = e;
		this.drawImage()
	};
	this.changeFontEffect = function(e) {
		o.fontEffect = e;
		this.drawImage()
	};
	this.changeFontSize = function(e) {
		o.fontSize = e;
		this.drawImage()
	};
	this.changeMargin = function(e) {
		o.margin = parseInt(e);
		this.drawImage()
	};
	this.changeWidth = function(e) {
		o.width = e > 300 ? 300 : e;
		v = e;
		this.drawImage()
	};
	this.changePtImage = function(e) {
		o.pinType = e;
		if (o.pinType != 0) {
			x([webroot+"plug/qrcode/images/diy/small/pin-" + o.pinType + ".png", webroot+"plug/qrcode/images/diy/big/pin-" + o.pinType + ".png"], function(e) {
				m.pin = e;
				u.drawImage()
			})
		} else {
			u.drawImage()
		}
	};
	this.changeRotate = function(e) {
		o.rotate = parseInt(e);
		this.drawImage()
	};
	this.changeTemplate = function(e) {
		o = $.extend({}, s, e);
		this.drawImage()
	};
	this.changeRound = function(e, t) {
		o.isWater = e;
		o.round = l * t;
		this.drawImage()
	};
	this.setRound = function(e, t) {
		o.isWater = e;
		o.round = l * t
	};
	this.resetWidth = function() {
		$("#" + e).attr({
			width: s.width,
			height: s.width
		});
		o.width = s.width;
		this.drawImage()
	};
	this.resetMargin = function() {
		o.margin = s.margin;
		this.drawImage()
	};
	this.resetBgColor = function() {
		o.bgColor = s.bgColor;
		this.drawImage()
	};
	this.resetFgColor = function() {
		o.fgColor = s.fgColor;
		this.drawImage()
	};
	this.resetPtColor = function() {
		o.ptColor = s.ptColor;
		this.drawImage()
	};
	this.resetInPtColor = function() {
		o.inptColor = s.inptColor;
		this.drawImage()
	};
	this.resetGcColor = function() {
		o.gcColor = s.gcColor;
		this.drawImage()
	};
	this.resetBackground = function() {
		o.background = s.background;
		this.drawImage()
	};
	this.resetForeground = function() {
		o.foreground = s.foreground;
		this.drawImage()
	};
	this.clearLogoimg = function() {
		o.logoimg = s.logoimg
	};
	this.resetLogoimg = function(e) {
		o.logoimg = s.logoimg;
		if (!o.logoimg && !o.content) {
			o.level = s.level;
			h = {};
			e()
		}
		N()
	};
	this.resetContent = function(e) {
		o.content = s.content;
		if (!o.logoimg && !o.content) {
			o.level = s.level;
			h = {};
			e()
		}
		N()
	};
	this.resetFtColor = function() {
		o.ftColor = s.ftColor;
		this.drawImage()
	};
	this.resetRound = function() {
		o.round = s.round;
		this.drawImage()
	};
	this.resetPaint = function() {
		paint_data = new Array;
		this.drawImage()
	};
	this.resetAll = function() {
		var e = o.text;
		o = $.extend({}, s, t);
		o.text = e;
		N()
	};
	this.getBase64 = function(e) {
		e = e || S;
		var t = "";
		if (v != o.width) {
			var n = v / s.width;
			var r = {
				width: o.width,
				margin: o.margin,
				round: o.round
			};
			o.width = v;
			o.margin = n * o.margin;
			o.round = n * o.round;
			g = 1;
			u.drawImage();
			t = a.toDataURL().substring(22);
			o = $.extend(o, r);
			g = 0;
			u.drawImage();
			e(t)
		} else {
			t = a.toDataURL().substring(22);
			e(t)
		}
	};
	var S = function() {};
	var x = function(e, t) {
			function r(i) {
				if (i < e.length) {
					var s = new Image;
					s.src = e[i];
					n.push(s);
					s.onload = function() {
						r(++i)
					}
				} else {
					t(n);
					return
				}
			}
			t = t || S;
			var n = [];
			if (e.length > 0) {
				r(0)
			} else {
				t()
			}
		};
	var T = function(e, t) {
			var n = e.target.files[0];
			if (n.type) {
				if (!/image\/\w+/.test(n.type)) {
					alert("请确保文件为图像类型");
					return false
				}
			}
			var r = new FileReader;
			r.readAsDataURL(n);
			$(r).load(function(e) {
				x([this.result], function(e) {
					o[t] = e[0];
					if (t == "logoimg") {
						h = B();
						N()
					} else {
						u.drawImage()
					}
				})
			})
		};
	var N = function(e) {
			e = e || S;
			var t = new QRCode(-1, QRErrorCorrectLevel[o.level]);
			t.addData(k(o.text));
			t.make();
			f = t.modules;
			var n = t.getModuleCount();
			c = [];
			for (i = 0; i < n; i++) {
				c[i] = []
			}
			u.drawImage();
			e()
		};
	var C = function(e, t) {
			var n = f.length;
			return !(e < 0 || t < 0 || e >= n || t >= n) && f[e][t]
		};
	var L = function(e, t, n) {
			var r = 0;
			if (e >= 2 && e < 5 && t >= 2 && t < 5) {
				r = 1
			} else if (e < 7 && t < 7) {
				r = 1
			} else if (e >= n - 5 && e < n - 2 && t >= 2 & t < 5) {
				r = 1
			} else if (e >= n - 7 && e < n && t >= 0 & t < 7) {
				r = 1
			} else if (e >= 2 && e < 5 && t >= n - 5 & t < n - 2) {
				r = 1
			} else if (e >= 0 && e < 7 && t >= n - 7 & t < n) {
				r = 1
			}
			return r
		};
	var A = function(e) {
			e.save();
			e.clip();
			var t = o.foreground.width;
			var n = o.foreground.height;
			if (t > 0) {
				for (var r = 0; r < o.width; r += t) {
					for (var i = 0; i < o.width; i += n) {
						e.drawImage(o.foreground, r, i, t, n)
					}
				}
			}
			e.restore()
		};
	var O = function(e, t, n, r) {
			var i = 0,
				s = 0;
			switch (r) {
			case 0:
				i = t * l + o.margin;
				s = n * l + o.margin;
				e.lineTo(i, s);
				break;
			case 1:
				i = t * l + l + o.margin;
				s = n * l + o.margin;
				e.lineTo(i, s);
				break;
			case 2:
				i = t * l + l + o.margin;
				s = n * l + l + o.margin;
				e.lineTo(i, s);
				break;
			case 3:
				i = t * l + o.margin;
				s = n * l + l + o.margin;
				e.lineTo(i, s);
				break;
			default:
			}
		};
	var M = function(e, t, n, r) {
			var i = 0,
				s = 0;
			switch (r) {
			case 0:
				i = t * l + o.round + o.margin;
				s = n * l + o.round + o.margin;
				e.arc(i, s, o.round, Math.PI, Math.PI * 1.5, false);
				i = t * l + l / 2 + o.margin;
				s = n * l + o.margin;
				e.lineTo(i, s);
				break;
			case 1:
				i = t * l + l - o.round + o.margin;
				s = n * l + o.round + o.margin;
				e.arc(i, s, o.round, Math.PI * 1.5, Math.PI * 2, false);
				break;
			case 2:
				i = t * l + l - o.round + o.margin;
				s = n * l + l - o.round + o.margin;
				e.arc(i, s, o.round, 0, Math.PI / 2, false);
				break;
			case 3:
				i = t * l + o.round + o.margin;
				s = n * l + l - o.round + o.margin;
				e.arc(i, s, o.round, Math.PI / 2, Math.PI, false);
				break;
			default:
			}
		};
	var _ = function(e, t, n, r, i) {
			var s, u;
			var a = o.width / 2;
			e.beginPath();
			if (o.gcColor != null) {
				i = d
			}
			e.fillStyle = i;
			e.strokeStyle = i;
			switch (r) {
			case 0:
				s = t * l + o.round + o.margin;
				u = n * l + o.round + o.margin;
				e.arc(s, u, o.round, Math.PI, Math.PI * 1.5, false);
				s = t * l + o.margin;
				u = n * l + o.margin;
				break;
			case 1:
				s = t * l + l - o.round + o.margin;
				u = n * l + o.round + o.margin;
				e.arc(s, u, o.round, Math.PI * 1.5, Math.PI * 2, false);
				s = t * l + l + o.margin;
				u = n * l + o.margin;
				break;
			case 2:
				s = t * l + l - o.round + o.margin;
				u = n * l + l - o.round + o.margin;
				e.arc(s, u, o.round, 0, Math.PI / 2, false);
				s = t * l + l + o.margin;
				u = n * l + l + o.margin;
				break;
			case 3:
				s = t * l + o.round + o.margin;
				u = n * l + l - o.round + o.margin;
				e.arc(s, u, o.round, Math.PI / 2, Math.PI, false);
				s = t * l + o.margin;
				u = n * l + l + o.margin;
				break;
			default:
			}
			e.lineTo(s, u);
			e.closePath();
			if (o.foreground != null) {
				A(e)
			} else {
				e.fill();
				e.stroke()
			}
		};
	var D = function(e, t, n) {
			grd = "";
			switch (o.gradientWay) {
			case "backslash":
				grd = e.createRadialGradient(0, 0, 0, n, n, o.width);
				break;
			case "slash":
				grd = e.createRadialGradient(n, n, o.width, 0, 0, 0);
				break;
			case "horizontal":
				grd = e.createLinearGradient(0, 0, o.width, 0);
				break;
			case "vertical":
				grd = e.createLinearGradient(0, 0, 0, o.width);
				break;
			case "circular":
				grd = e.createRadialGradient(n, n, o.width / 4, n, n, n);
				break;
			default:
				grd = o.fgColor;
				break
			}
			if (o.gradientWay != 0) {
				grd.addColorStop(0, t);
				grd.addColorStop(1, o.gcColor)
			}
			return grd
		};
	var P = function(e, t, n) {
			var r;
			var i = o.inptColor ? o.inptColor : o.fgColor;
			var s = o.ptColor ? o.ptColor : o.fgColor;
			if (e >= 2 && e < 5 && t >= 2 && t < 5) {
				r = i
			} else if (e < 7 && t < 7) {
				r = s
			} else if (e >= n - 5 && e < n - 2 && t >= 2 & t < 5) {
				r = i
			} else if (e >= n - 7 && e < n && t >= 0 & t < 7) {
				r = s
			} else if (e >= 2 && e < 5 && t >= n - 5 & t < n - 2) {
				r = i
			} else if (e >= 0 && e < 7 && t >= n - 7 & t < n) {
				r = s
			} else {
				r = o.fgColor
			}
			return r
		};
	var H = function(e, t) {
			var n = f.length;
			var r = Math.floor((e - o.margin) / l);
			var i = Math.floor((t - o.margin) / l);
			if (0 <= i && i < n && 0 <= r && r < n) {
				c[i][r] = o.paintColor
			}
		};
	var B = function() {
			if (o.logoimg != null && o.level != "L") {
				var e = o.logoimg.width;
				var t = o.logoimg.height;
				var n = 0,
					r = 0,
					i = 0,
					u = 0,
					a = 0;
				var f = s.width - s.margin * 2;
				switch (o.level) {
				case "M":
					a = Math.floor(f / 5);
					break;
				case "Q":
					a = Math.floor(f / 4);
					break;
				case "H":
					a = Math.floor(f * .3);
					break;
				default:
					a = Math.floor(f * .3);
					break
				}
				if (e > 0) {
					if (Math.max(e, t) < a) {
						n = e;
						r = t
					} else {
						if (e > t) {
							n = a;
							r = Math.floor(t * (a / e))
						} else {
							r = a;
							n = Math.floor(e * (a / t))
						}
					}
					i = Math.floor(s.width / 2 - n / 2);
					u = Math.floor(s.width / 2 - r / 2)
				}
				return {
					left: i,
					top: u,
					width: n,
					height: r
				}
			}
		};
	var j = function(e) {
			if (o.pinType != 0) {
				var t = Math.round(l * 9);
				var n = pt_top = Math.floor(o.margin - l);
				var r = pt_bottom = Math.ceil(o.width - o.margin - 8 * l);
				e.save();
				e.beginPath();
				e.fillStyle = o.ptColor || o.fgColor;
				e.fillRect(o.margin - l + 1, o.margin - l + 1, l * 9 - 2, l * 9 - 2);
				e.fillStyle = o.inptColor || o.fgColor;
				switch (o.pinType) {
				case 7:
					e.moveTo(4 * l + o.margin - l, 3 * l + o.margin - l);
					e.lineTo(5.64 * l + o.margin - l, 3.4 * l + o.margin - l);
					e.lineTo(6.18 * l + o.margin - l, 4.3 * l + o.margin - l);
					e.lineTo(5.1 * l + o.margin - l, 6.52 * l + o.margin - l);
					e.lineTo(3.66 * l + o.margin - l, 6.54 * l + o.margin - l);
					e.lineTo(2.52 * l + o.margin - l, 5.56 * l + o.margin - l);
					e.lineTo(2.52 * l + o.margin - l, 4.22 * l + o.margin - l);
					e.fill();
					break;
				case 2:
				case 3:
				case 4:
				case 6:
				case 9:
				case 10:
				case 12:
				case 13:
				case 14:
				case 15:
				case 16:
				case 17:
					e.fillRect(o.margin + l * 1.4 - 1, o.margin + l * 1.4 - 1, l * 4.2 + 1, l * 4.2 + 1);
					break;
				default:
					e.fillRect(o.margin + l * 2 - 1, o.margin + l * 2 - 1, l * 3 + 1, l * 3 + 1)
				}
				e.rect(o.margin - l, o.margin - l, l * 9, l * 9);
				e.clip();
				e.closePath();
				e.globalCompositeOperation = "destination-in";
				e.drawImage(m.pin[g], n, pt_top, t, t);
				e.restore();
				var s = e.getImageData(n, pt_top, t, t);
				var u = e.createImageData(s.width, s.height);
				var a = e.createImageData(s.width, s.height);
				var f = s.data;
				var c = u.data;
				var h = a.data;
				var p = s.data.length;
				var d = s.width;
				var v = s.height;
				for (i = 0; i < p; i += 4) {
					var y = Math.floor(i / d / 4);
					var b = i % (d * 4);
					var w = y * d * 4 + (d * 4 - b) - 4;
					var E = (v - 1 - y) * d * 4 + b;
					c[w] = h[E] = f[i];
					c[w + 1] = h[E + 1] = f[i + 1];
					c[w + 2] = h[E + 2] = f[i + 2];
					c[w + 3] = h[E + 3] = f[i + 3]
				}
				e.putImageData(u, r, pt_top);
				e.putImageData(a, n, pt_bottom);
				e.restore();
				F(e, n, pt_top);
				F(e, r, pt_top);
				F(e, n, pt_bottom)
			}
		};
	var F = function(e, t, n) {
			var r = Math.round(l * 9);
			if (o.gcColor != null && !o.ptColor && !o.inptColor) {
				e.save();
				e.globalCompositeOperation = "source-atop";
				var i = o.ptColor || o.fgColor;
				var s = D(e, i, o.width / 2);
				e.fillStyle = s;
				e.fillRect(t + 1, n + 1, r - 2, r - 2);
				e.rect(t, n, r, r);
				e.clip();
				e.restore()
			}
			e.save();
			e.globalCompositeOperation = "destination-over";
			e.fillStyle = o.bgColor;
			e.fillRect(t - 1, n - 1, r + 2, r + 2);
			e.globalCompositeOperation = "source-over";
			e.restore()
		};
	var I = function(e, t, n, r, i, s, o) {
			e.save();
			q(e, t, 9 + n, r - n, i - n, s + 2 * n, o + 2 * n);
			e.fillStyle = "#fff";
			e.fill();
			e.restore();
			e.save();
			q(e, t, 9, r, i, s, o);
			e.clip();
			e.drawImage(t, r, i, s, o);
			e.restore()
		};
	var q = function(e, t, n, r, i, s, o) {
			e.beginPath();
			e.arc(r + s - n, i + n, n, 0, Math.PI * 1.5, true);
			e.lineTo(r + n, i);
			e.arc(r + n, i + n, n, Math.PI * 1.5, Math.PI * 1, true);
			e.lineTo(r, i + o - n);
			e.arc(r + n, i + o - n, n, Math.PI * 1, Math.PI * .5, true);
			e.lineTo(r + s - n, i + o);
			e.arc(r + s - n, i + o - n, n, Math.PI * .5, 0, true);
			e.closePath()
		};
	var R = function(e, t, n, r, i, s, o) {
			e.save();
			e.fillStyle = "#fff";
			e.fillRect(r - n, i - n, s + 2 * n, o + 2 * n);
			e.drawImage(t, r, i, s, o);
			e.restore()
		};
	var U = function(e, t, n, r, i, s, o) {
			e.save();
			e.shadowBlur = 0;
			e.shadowColor = "#FFF";
			for (var u = 0; u < 2 * n + 1; u++) {
				for (var a = 0; a < 2 * n + 1; a++) {
					e.save();
					e.shadowOffsetX = -n - 2e3 + a;
					e.shadowOffsetY = -n + u;
					e.drawImage(t, r + 2e3, i, s, o)
				}
			}
			e.drawImage(t, r, i, s, o);
			e.restore();
			e.shadowOffsetX = 0;
			e.shadowOffsetY = 0
		};
	var z = function(e) {
			if (o.content) {
				var t = o.gcColor ? D(e, o.fgColor, o.width / 2) : o.fgColor;
				var n = o.width / s.width;
				e.globalCompositeOperation = "source-over";
				e.save();
				e.textBaseline = "middle";
				e.textAlign = "center";
				e.font = "bold " + o.fontSize * n + "px KaiTi_GB2312";
				switch (o.fontEffect) {
				case "in":
					e.lineWidth = 8 * n;
					e.fillStyle = t;
					e.strokeStyle = o.bgColor;
					e.strokeText(o.content, o.width / 2, o.width / 2);
					e.fillText(o.content, o.width / 2, o.width / 2);
					break;
				case "out":
					e.lineWidth = 8 * n;
					e.fillStyle = o.bgColor;
					e.strokeStyle = t;
					e.strokeText(o.content, o.width / 2, o.width / 2);
					e.fillText(o.content, o.width / 2, o.width / 2);
					break;
				case "stretch":
					r = 16 * n;
					e.lineWidth = 2 * n;
					e.fillStyle = o.ftColor ? o.ftColor : t;
					e.strokeStyle = "#fff";
					for (var i = 0; i < r; i++) {
						e.globalAlpha = (i + 1) / r;
						e.strokeText(o.content, o.width / 2, o.width / 2 - r + i);
						e.fillText(o.content, o.width / 2, o.width / 2 - r + i)
					}
					break;
				case "3d":
					r = 5 * n;
					e.lineWidth = 4 * n;
					e.fillStyle = o.ftColor ? o.ftColor : t;
					e.strokeStyle = "#fff";
					for (var i = 0; i < r; i++) {
						e.globalAlpha = (i + 1) / r;
						e.strokeText(o.content, o.width / 2 + r - i * 2, o.width / 2 - r + i);
						e.fillText(o.content, o.width / 2 + r - i * 2, o.width / 2 - r + i)
					}
					break;
				case "light":
					e.lineWidth = 2 * n;
					e.fillStyle = o.ftColor ? o.ftColor : t;
					e.shadowColor = "#fff";
					e.shadowOffsetX = 2 * n;
					e.shadowOffsetY = -2 * n;
					e.shadowBlur = 6 * n;
					e.strokeStyle = "#fff";
					e.strokeText(o.content, o.width / 2, o.width / 2);
					e.fillText(o.content, o.width / 2, o.width / 2);
					break;
				default:
					e.lineWidth = 6 * n;
					e.strokeStyle = "#fff";
					e.strokeText(o.content, o.width / 2, o.width / 2);
					e.fillStyle = o.ftColor || "#000";
					e.fillText(o.content, o.width / 2, o.width / 2)
				}
				e.restore()
			}
		};
	var W = function(e, t, n, r, s) {
			e.save();
			var o = e.getImageData(t, n, r, s);
			var u = e.createImageData(o.width, o.height);
			var a = o.data;
			var f = u.data;
			var l = o.data.length;
			var c = o.width;
			for (i = 0; i < l; i += 4) {
				var h = Math.floor(i / c / 4);
				var p = i % (c * 4);
				var d = p * c + (c - h - 1) * 4;
				f[d] = a[i];
				f[d + 1] = a[i + 1];
				f[d + 2] = a[i + 2];
				f[d + 3] = a[i + 3]
			}
			e.putImageData(u, t, n);
			e.restore()
		};
	var X = function() {
			var e = 0;
			var t = 0;
			$(a).bind({
				mousedown: function(n) {
					var r = o.width / s.width;
					var i = $(this).position();
					var u = n.clientX - i.left;
					var a = n.clientY - i.top + $(window).scrollTop();
					if (u > h.left * r && u < (h.left + h.width) * r && a > h.top * r && a < (h.top + h.height) * r) {
						b = true;
						e = h.left - u;
						t = h.top - a
					} else {
						b = false
					}
					y = true
				},
				mouseup: function(e) {
					var t = $(this).position();
					var n = e.clientX - t.left;
					var r = e.clientY - t.top + $(window).scrollTop();
					if (!b && !E) {}
					y = false;
					b = false;
					E = false;
					u.drawImage()
				},
				mousemove: function(n) {
					var r = o.width / s.width;
					var i = $(this).position();
					var a = n.clientX - i.left;
					var f = n.clientY - i.top + $(window).scrollTop();
					if (a > h.left * r - 8 && a < (h.left + h.width) * r + 8 && f > h.top * r - 8 && f < (h.top + h.height) * r + 8) {
						if (a > h.left * r && a < (h.left + h.width) * r && f > h.top * r && f < (h.top + h.height) * r) {
							$(this).css("cursor", "move")
						} else {
							$(this).css("cursor", "default")
						}
						w = true
					} else {
						$(this).css("cursor", "default");
						w = false
					}
					if (b) {
						h.left = e + a;
						h.top = t + f;
						u.drawImage()
					} else if (y) {
						u.drawImage()
					}
				},
				mouseleave: function(e) {
					y = false;
					b = false;
					E = false
				}
			});
			N()
		};
	X()
}