嗨,我设法使excanvas在IE8中为简单的示例工作,但是我无法制作下面的画布示例,其中包含IE8的绘图图像工作。有没有人有过超能力和绘画的经验。谢谢你的帮助..。
var foo = document.getElementById("foo");
var canvas = document.createElement('canvas');`canvas.setAttribute("width", 300);
canvas.setAttribute("height", 300);
foo.appendChild(canvas);
canvas= G_vmlCanvasManager.initElement(canvas);
var ctx = canvas.getContext('2d');
ctx.save();
`ctx.clearRect( 0, 0, canvas.width, canvas.height );` `ctx.translate( canvas.width/2 , canvas.height/2 );` `ctx.drawImage( image, -165, -160 );` `ctx.rotate( 100 * Math.PI / 180);` `ctx.drawImage( image2, -13, -121.5 );` `ctx.restore();`image1.src = 'img.png';
image2.src = 'img2.png';发布于 2016-08-24 15:37:15
使用测试用例隔离drawImage:
<!DOCTYPE html>
<html>
<head>
<title>Overflow Test</title>
<style>
body {
text-align: center
}
</style>
<!--[if IE]><script src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/excanvas.js"></script><![endif]-->
<script>
window.onload = function() {
var ctx = document.getElementById('c').getContext('2d');
var img = document.images[0];
ctx.rotate(Math.PI / 8);
ctx.drawImage(img, 50, 50);
img.style.display = 'none';
};
</script>
</head>
<body>
<img src="http://opera.com/favicon.ico">
<canvas id="c" width="200" height="200"></canvas>
</body>
</html>
参考资料
https://stackoverflow.com/questions/15816263
复制相似问题