Пример #1
0
        private string sample23(ICanvasRenderingContext2D ctx)
        {
            double sin = Math.Sin(Math.PI/6);
            double cos = Math.Cos(Math.PI/6);
            ctx.translate(150, 150);
            double c = 0;
            for (int i = 0; i <= 12; i++)
            {
                c = Math.Floor(Convert.ToDouble(255/12*i));
                ctx.fillStyle = "rgb(" + c + "," + c + "," + c + ")";
                ctx.fillRect(0, 0, 100, 10);
                ctx.transform(cos, sin, -sin, cos, 0, 0);
            }

            ctx.setTransform(-1, 0, 0, 1, 150, 150);
            ctx.fillStyle = "rgba(255, 128, 255, 0.5)";
            ctx.fillRect(0, 50, 100, 100);
            return @"Originals\Transformations\sample23.png";
        }