private void Draw(PaintArgs p, Point centerPoint, Color backColor) { if (this.Style != MarkerStyleLabel.None) { Rectangle rectangle; if (this.Style == MarkerStyleLabel.Circle) { p.Graphics.SmoothingMode = SmoothingMode.AntiAlias; rectangle = new Rectangle(centerPoint.X - this.Size, centerPoint.Y - this.Size, 2 * this.Size, 2 * this.Size); BorderSpecial.DrawEllipse(p, rectangle, this.BevelStyle, 1f, backColor); rectangle.Inflate(-2, -2); p.Graphics.FillEllipse(p.Graphics.Brush(this.Color), rectangle); rectangle.Inflate(2, 2); p.Graphics.SmoothingMode = SmoothingMode.Default; } else if (this.Style == MarkerStyleLabel.Square) { rectangle = new Rectangle(centerPoint.X - this.Size, centerPoint.Y - this.Size, 2 * this.Size, 2 * this.Size); p.Graphics.FillRectangle(p.Graphics.Brush(this.Color), rectangle); BorderSpecial.DrawRectangle(p, rectangle, this.BevelStyle, 2, backColor); } else if (this.Style == MarkerStyleLabel.Line) { rectangle = new Rectangle(centerPoint.X - this.Size, centerPoint.Y - 1, 2 * this.Size, 2); if (this.BevelStyle == BevelStyle.Raised) { BorderSimple.Draw(p, rectangle, BorderStyleSimple.RaisedInner, backColor); } else if (this.BevelStyle == BevelStyle.Sunken) { BorderSimple.Draw(p, rectangle, BorderStyleSimple.SunkenInner, backColor); } } } }
public void Draw(PaintArgs p, Font font, Color foreColor, Color backColor) { if (this.Source != null && this.Visible) { string s = this.Source.Object.ToString(); Rectangle bounds = this.Bounds; DrawStringFormat genericDefault = DrawStringFormat.GenericDefault; genericDefault.Alignment = StringAlignment.Center; genericDefault.LineAlignment = StringAlignment.Center; p.Graphics.FillRectangle(p.Graphics.Brush(backColor), bounds); BorderSimple.Draw(p, bounds, BorderStyleSimple.Raised, backColor); TextRotation rotation = (this.Destination.Object == null || this.Destination.Object is PlotDataView) ? ((this.DestinationSide != 0) ? ((this.DestinationSide == PlotDragSide.Right) ? TextRotation.X090 : TextRotation.X000) : TextRotation.X270) : ((!this.Destination.Object.DockLeft) ? (this.Destination.Object.DockRight ? TextRotation.X090 : TextRotation.X000) : TextRotation.X270); p.Graphics.DrawRotatedText(s, font, foreColor, bounds, rotation, genericDefault); } }
public void Draw(PaintArgs p, Font font, Color foreColor, Color backColor) { if (this.Object != null && this.Visible) { string s = this.Object.ToString(); Rectangle rectangle = (!(this is PlotLayoutBlockGroup)) ? this.BoundsLayout : (this as PlotLayoutBlockGroup).InnerRectangleLayout; DrawStringFormat genericDefault = DrawStringFormat.GenericDefault; genericDefault.Alignment = StringAlignment.Center; genericDefault.LineAlignment = StringAlignment.Center; p.Graphics.FillRectangle(p.Graphics.Brush(this.BackColor), rectangle); BorderSimple.Draw(p, rectangle, BorderStyleSimple.Raised, backColor); TextRotation rotation = (!(this.Object is PlotDataView)) ? ((!this.Object.DockLeft) ? (this.Object.DockRight ? TextRotation.X090 : TextRotation.X000) : TextRotation.X270) : TextRotation.X000; p.Graphics.DrawRotatedText(s, font, foreColor, rectangle, rotation, genericDefault); } }
protected void Draw(PaintArgs p, Rectangle r, BorderStyleControl style, int thickness, Color color) { switch (style) { case BorderStyleControl.None: return; case BorderStyleControl.RoundedSides: BorderSpecial.DrawRoundedSides(p, r, BevelStyle.Raised, thickness, color); return; case BorderStyleControl.Raised: if (thickness <= 2) { break; } BorderSpecial.DrawRectangle(p, r, BevelStyle.Raised, thickness, color); return; } if (style == BorderStyleControl.Sunken && thickness > 2) { BorderSpecial.DrawRectangle(p, r, BevelStyle.Sunken, thickness, color); } else { switch (style) { case BorderStyleControl.Raised: BorderSimple.Draw(p, r, BorderStyleSimple.Raised, color); break; case BorderStyleControl.Sunken: BorderSimple.Draw(p, r, BorderStyleSimple.Sunken, color); break; case BorderStyleControl.Bump: BorderSimple.Draw(p, r, BorderStyleSimple.Bump, color); break; case BorderStyleControl.Etched: BorderSimple.Draw(p, r, BorderStyleSimple.Etched, color); break; case BorderStyleControl.Flat: BorderSimple.Draw(p, r, BorderStyleSimple.Flat, color); break; case BorderStyleControl.RaisedInner: BorderSimple.Draw(p, r, BorderStyleSimple.RaisedInner, color); break; case BorderStyleControl.RaisedOuter: BorderSimple.Draw(p, r, BorderStyleSimple.RaisedOuter, color); break; case BorderStyleControl.SunkenInner: BorderSimple.Draw(p, r, BorderStyleSimple.SunkenInner, color); break; case BorderStyleControl.SunkenOuter: BorderSimple.Draw(p, r, BorderStyleSimple.SunkenOuter, color); break; } } }
public static void Draw(PaintArgs p, Rectangle r, BorderStyleSimple style, Color color) { Color color2; Color color3; Color color4; Color color5; if (color != SystemColors.Control) { color2 = iColors.Lighten2(color); color3 = iColors.Darken4(color); color4 = iColors.Lighten4(color); color5 = iColors.Darken2(color); } else { color2 = SystemColors.ControlLight; color3 = SystemColors.ControlDarkDark; color4 = SystemColors.ControlLightLight; color5 = SystemColors.ControlDark; } Color[] array = new Color[4]; switch (style) { case BorderStyleSimple.Raised: array[0] = color2; array[1] = color3; array[2] = color4; array[3] = color5; break; case BorderStyleSimple.Sunken: array[0] = color5; array[1] = color4; array[2] = color3; array[3] = color2; break; case BorderStyleSimple.Bump: array[0] = color2; array[1] = color3; array[2] = color3; array[3] = color2; break; case BorderStyleSimple.Etched: array[0] = color5; array[1] = color4; array[2] = color4; array[3] = color5; break; case BorderStyleSimple.RaisedInner: array[0] = color4; array[1] = color5; break; case BorderStyleSimple.RaisedOuter: array[0] = color2; array[1] = color3; break; case BorderStyleSimple.SunkenInner: array[0] = color3; array[1] = color2; break; case BorderStyleSimple.SunkenOuter: array[0] = color5; array[1] = color4; break; case BorderStyleSimple.Flat: array[0] = Color.Black; array[1] = Color.Black; break; } Point[] borderUpperLeftPoints = BorderSimple.GetBorderUpperLeftPoints(p, r); p.Graphics.DrawLines(p.Graphics.Pen(array[0]), borderUpperLeftPoints); borderUpperLeftPoints = BorderSimple.GetBorderLowerRightPoints(p, r); p.Graphics.DrawLines(p.Graphics.Pen(array[1]), borderUpperLeftPoints); if (style != BorderStyleSimple.Raised && style != BorderStyleSimple.Sunken && style != BorderStyleSimple.Bump && style != BorderStyleSimple.Etched) { return; } r.Inflate(-1, -1); borderUpperLeftPoints = BorderSimple.GetBorderUpperLeftPoints(p, r); p.Graphics.DrawLines(p.Graphics.Pen(array[2]), borderUpperLeftPoints); borderUpperLeftPoints = BorderSimple.GetBorderLowerRightPoints(p, r); p.Graphics.DrawLines(p.Graphics.Pen(array[3]), borderUpperLeftPoints); }