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 } }
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); }
private static void DrawSingleSquareCuts(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 + gap, rT, rL + gap, rT + gap); // V renderer.DrawLine(p, rL, rT + gap, rL + gap, rT + gap); // H // RT corner renderer.DrawLine(p, rR - gap, rT, rR - gap, rT + gap); // V renderer.DrawLine(p, rR, rT + gap, rR - gap, rT + gap); // H // LB corner renderer.DrawLine(p, rL + gap, rB, rL + gap, rB - gap); // V renderer.DrawLine(p, rL, rB - gap, rL + gap, rB - gap); // H // RB corner renderer.DrawLine(p, rR - gap, rB, rR - gap, rB - gap); // V renderer.DrawLine(p, rR, rB - gap, rR - gap, rB - gap); // H } }
private static void DrawDoubleRect(ChartRenderer renderer, int rL, int rT, int rW, int rH, int streak, float pw) { using (var pen = renderer.CreatePen(BSDColors.Black, pw)) { renderer.DrawRectangle(pen, null, rL, rT, rW, rH); rL += streak; rT += streak; rW -= streak * 2; rH -= streak * 2; renderer.DrawRectangle(pen, null, rL, rT, rW, rH); } }
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); } }
private static void DrawSingleRect(ChartRenderer renderer, int rL, int rT, int rW, int rH, float pw) { using (var pen = renderer.CreatePen(BSDColors.Black, pw)) { renderer.DrawRectangle(pen, null, rL, rT, rW, rH); } }