OurSonic.Utility.CanvasInformation.Create C# (CSharp) Method

Create() public static method

public static Create ( CanvasElement canvas, int w, int h, bool pixelated ) : CanvasInformation
canvas System.Html.CanvasElement
w int
h int
pixelated bool
return CanvasInformation
        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));
        }
    }

Same methods

CanvasInformation::Create ( int w, int h, bool pixelated ) : CanvasInformation