public static CanvasInformation Create(CanvasElement canvas, int w, int h,bool pixelated)
{
if (w == 0) w = 1;
if (h == 0) h = 1;
canvas.Width = w;
canvas.Height = h;
var ctx = (CanvasRenderingContext2D) canvas.GetContext("2d");
if (pixelated)
{
ctx.Me().webkitImageSmoothingEnabled = false;
ctx.Me().mozImageSmoothingEnabled = false;
ctx.Me().imageSmoothingEnabled = false;
}
return new CanvasInformation(ctx, jQuery.FromElement(canvas));
}
}