public static void DrawSelection(Graphics G, xColorTable ColorTable, Rectangle Rect) { Rectangle TopRect = default(Rectangle); Rectangle BottomRect = default(Rectangle); Rectangle FillRect = new Rectangle(Rect.X + 1, Rect.Y + 1, Rect.Width - 1, Rect.Height - 1); TopRect = FillRect; TopRect.Height -= System.Convert.ToInt32(TopRect.Height / 2); BottomRect = new Rectangle(TopRect.X, TopRect.Bottom, TopRect.Width, FillRect.Height - TopRect.Height); // Top gradient using (LinearGradientBrush LGB = new LinearGradientBrush(TopRect, ColorTable.SelectionTopGradient, ColorTable.SelectionMidGradient, LinearGradientMode.Vertical)) { G.FillRectangle(LGB, TopRect); } // Bottom using (SolidBrush B1 = new SolidBrush(ColorTable.SelectionBottomGradient)) { G.FillRectangle(B1, BottomRect); } // Border using (Pen P1 = new Pen(ColorTable.SelectionBorder)) { RectDrawing.DrawRoundedRectangle(G, P1, System.Convert.ToSingle(Rect.X), System.Convert.ToSingle(Rect.Y), System.Convert.ToSingle(Rect.Width), System.Convert.ToSingle(Rect.Height), 2); } }
public MSColorTable() { _CommonColorTable = new DefaultCColorTable(); }