Comments on: Canvas in IE Feedback http://me.eae.net/archive/2006/01/07/canvas-in-ie-feedback/ The journal of Emil A Eklund Tue, 24 Oct 2017 05:04:38 +0000 http://wordpress.org/?v=2.0 by: EI http://me.eae.net/archive/2006/01/07/canvas-in-ie-feedback/#comment-56482 Sun, 18 Mar 2007 15:06:21 +0000 http://me.eae.net/archive/2006/01/07/canvas-in-ie-feedback/#comment-56482 translate don't work on this :-( Canvas demo window.onload = function() { ieCanvasInit("iecanvas.htc"); } function drawBowtie(ctx, fillStyle) { ctx.globalAlpha = 0.3; ctx.fillStyle = "rgb(200,200,200)"; ctx.fillRect(-30, -30, 60, 60); ctx.fillStyle = fillStyle; ctx.globalAlpha = 1.0; ctx.beginPath(); ctx.moveTo(25, 25); ctx.lineTo(-25, -25); ctx.lineTo(25, -25); ctx.lineTo(-25, 25); ctx.closePath(); ctx.fill(); } function dot(ctx) { ctx.save(); ctx.fillStyle = "black"; ctx.fillRect(-2, -2, 4, 4); ctx.restore(); } function draw () { var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); // note that all other translates are relative to this // one ctx.translate(45, 45); ctx.save(); //ctx.translate(0, 0); // unnecessary drawBowtie(ctx, "red"); dot(ctx); ctx.restore(); ctx.save(); ctx.translate(85, 0); ctx.rotate(45 * Math.PI / 180); drawBowtie(ctx, "green"); dot(ctx); ctx.restore(); ctx.save(); ctx.translate(0, 85); ctx.rotate(135 * Math.PI / 180); drawBowtie(ctx, "blue"); dot(ctx); ctx.restore(); ctx.save(); ctx.translate(85, 85); ctx.rotate(90 * Math.PI / 180); drawBowtie(ctx, "yellow"); dot(ctx); ctx.restore(); } draw translate don’t work on this :-(

Canvas demo

window.onload = function() { ieCanvasInit(”iecanvas.htc”); }

function drawBowtie(ctx, fillStyle) {

ctx.globalAlpha = 0.3;
ctx.fillStyle = “rgb(200,200,200)”;
ctx.fillRect(-30, -30, 60, 60);

ctx.fillStyle = fillStyle;
ctx.globalAlpha = 1.0;
ctx.beginPath();
ctx.moveTo(25, 25);
ctx.lineTo(-25, -25);
ctx.lineTo(25, -25);
ctx.lineTo(-25, 25);
ctx.closePath();
ctx.fill();
}

function dot(ctx) {
ctx.save();
ctx.fillStyle = “black”;
ctx.fillRect(-2, -2, 4, 4);
ctx.restore();
}

function draw () {
var canvas = document.getElementById(”canvas”);
var ctx = canvas.getContext(”2d”);

// note that all other translates are relative to this
// one
ctx.translate(45, 45);

ctx.save();
//ctx.translate(0, 0); // unnecessary
drawBowtie(ctx, “red”);
dot(ctx);
ctx.restore();

ctx.save();
ctx.translate(85, 0);
ctx.rotate(45 * Math.PI / 180);
drawBowtie(ctx, “green”);
dot(ctx);
ctx.restore();

ctx.save();
ctx.translate(0, 85);
ctx.rotate(135 * Math.PI / 180);
drawBowtie(ctx, “blue”);
dot(ctx);
ctx.restore();

ctx.save();
ctx.translate(85, 85);
ctx.rotate(90 * Math.PI / 180);
drawBowtie(ctx, “yellow”);
dot(ctx);
ctx.restore();
}

draw

]]>
by: Ivan http://me.eae.net/archive/2006/01/07/canvas-in-ie-feedback/#comment-3278 Fri, 21 Jul 2006 08:31:14 +0000 http://me.eae.net/archive/2006/01/07/canvas-in-ie-feedback/#comment-3278 I like your chart, it's simple to use and it looks really nice. There is only one step to perfection: How to print it from IE? It is not visible in print preview, and it won't print. In Firefox I see chart in print preview, but still nothing on paper. Can anyone help me how to print canvas from browser? I like your chart, it’s simple to use and it looks really nice.
There is only one step to perfection: How to print it from IE? It is not visible in print preview, and it won’t print. In Firefox I see chart in print preview, but still nothing on paper. Can anyone help me how to print canvas from browser?

]]>
by: Erik Arvidsson http://me.eae.net/archive/2006/01/07/canvas-in-ie-feedback/#comment-407 Wed, 11 Jan 2006 05:42:01 +0000 http://me.eae.net/archive/2006/01/07/canvas-in-ie-feedback/#comment-407 If it works then use it. And today Canvas + IeVmlCanvas works for a lot of things If it works then use it.

And today Canvas + IeVmlCanvas works for a lot of things

]]>