Exemple #1
0
        private static void DrawCrossCorners(ChartRenderer renderer, int rL, int rT, int rR, int rB, float gap, float pw)
        {
            DrawDoubleSquareCuts(renderer, rL, rT, rR, rB, gap, DefaultStreak, pw);

            int xgap = (int)(gap / 2);

            rL += xgap;
            rT += xgap;
            rR -= xgap;
            rB -= xgap;

            using (var pen = renderer.CreatePen(BSDColors.Silver, DefaultStreak)) {
                renderer.DrawLine(pen, rL, rB, rL, rT); // L
                renderer.DrawLine(pen, rL, rT, rR, rT); // T
                renderer.DrawLine(pen, rL, rB, rR, rB); // B
                renderer.DrawLine(pen, rR, rB, rR, rT); // R
            }

            int halfStreak = DefaultStreak / 2;

            rL -= halfStreak;
            rT -= halfStreak;
            rR += halfStreak;
            rB += halfStreak;
            DrawSingleRect(renderer, rL, rT, (rR - rL), (rB - rT), pw);
            rL += DefaultStreak;
            rT += DefaultStreak;
            rR -= DefaultStreak;
            rB -= DefaultStreak;
            DrawSingleRect(renderer, rL, rT, (rR - rL), (rB - rT), pw);
        }
Exemple #2
0
        private static void Draw3D(ChartRenderer renderer, int rL, int rT, int rR, int rB, GfxBorderStyle borderStyle, float pw)
        {
            int[] colors;
            bool  sunken = (borderStyle == GfxBorderStyle.Sunken3D);

            if (sunken)
            {
                colors = new int[] {
                    BSDColors.ControlDark, BSDColors.ControlDarkDark, BSDColors.ControlLightLight, BSDColors.ControlLight
                };
            }
            else
            {
                colors = new int[] {
                    BSDColors.ControlLightLight, BSDColors.ControlLight, BSDColors.ControlDark, BSDColors.ControlDarkDark
                };
            }

            using (var p = renderer.CreatePen(colors[0], pw)) {
                renderer.DrawLine(p, rL, rB - 1, rL, rT); // L
                renderer.DrawLine(p, rL, rT, rR - 1, rT); // T
            }
            using (var p = renderer.CreatePen(colors[1], pw)) {
                renderer.DrawLine(p, rL + pw, rB - 2, rL + pw, rT + pw); // L
                renderer.DrawLine(p, rL + pw, rT + pw, rR - 2, rT + pw); // T
            }
            using (var p = renderer.CreatePen(colors[2], pw)) {
                renderer.DrawLine(p, rL, rB, rR, rB); // B
                renderer.DrawLine(p, rR, rB, rR, rT); // R
            }
            using (var p = renderer.CreatePen(colors[3], pw)) {
                renderer.DrawLine(p, rL + pw, rB - pw, rR - pw, rB - pw); // B
                renderer.DrawLine(p, rR - pw, rB - pw, rR - pw, rT + pw); // R
            }
        }
Exemple #3
0
        private static void DrawSingleRoundCuts(ChartRenderer renderer, int rL, int rT, int rR, int rB, float gap, float pw)
        {
            using (var p = renderer.CreatePen(BSDColors.Black, pw)) {
                renderer.DrawLine(p, rL, rB - gap, rL, rT + gap); // L
                renderer.DrawLine(p, rL + gap, rT, rR - gap, rT); // T
                renderer.DrawLine(p, rL + gap, rB, rR - gap, rB); // B
                renderer.DrawLine(p, rR, rB - gap, rR, rT + gap); // R

                float gap2 = gap * 2;

                // LT corner
                renderer.DrawArc(p, rL - gap, rT - gap, gap2, gap2, 0, 90);

                // RT corner
                renderer.DrawArc(p, rR - gap, rT - gap, gap2, gap2, 90, 90);

                // LB corner
                renderer.DrawArc(p, rL - gap, rB - gap, gap2, gap2, 270, 90);

                // RB corner
                renderer.DrawArc(p, rR - gap, rB - gap, gap2, gap2, 180, 90);
            }
        }
Exemple #4
0
        private static void DrawSingleBevels(ChartRenderer renderer, int rL, int rT, int rR, int rB, float gap, float pw)
        {
            using (var p = renderer.CreatePen(BSDColors.Black, pw)) {
                renderer.DrawLine(p, rL, rB - gap, rL, rT + gap); // L
                renderer.DrawLine(p, rL + gap, rT, rR - gap, rT); // T
                renderer.DrawLine(p, rL + gap, rB, rR - gap, rB); // B
                renderer.DrawLine(p, rR, rB - gap, rR, rT + gap); // R

                // LT corner
                renderer.DrawLine(p, rL, rT + gap, rL + gap, rT);

                // RT corner
                renderer.DrawLine(p, rR - gap, rT, rR, rT + gap);

                // LB corner
                renderer.DrawLine(p, rL + gap, rB, rL, rB - gap);

                // RB corner
                renderer.DrawLine(p, rR, rB - gap, rR - gap, rB);
            }
        }