Northwoods.Go.Draw Assembly > Northwoods.Go.Draw Namespace : GoRulerCursor Class |
public class TriangleCursor : GoRulerCursor { public TriangleCursor() { this.Size = new Size(10, 20); this.ForeColor = Color.Blue; this.BackColor = Color.LightBlue; } public override void Paint(Graphics g, GoRuler ruler, float measure) { Pen p = new Pen(this.ForeColor, 0); Brush b = new SolidBrush(this.BackColor); Rectangle r = ruler.DisplayRectangle; float left = measure - this.Width/2.0f; float right = measure + this.Width/2.0f; PointF[] pts; if (ruler.Orientation == Orientation.Horizontal) pts = new PointF[] {new PointF(left, r.Y), new PointF(right, r.Y), new PointF(measure, r.Bottom)}; else pts = new PointF[] {new PointF(r.X, left), new PointF(r.X, right), new PointF(r.Right, measure)}; g.FillPolygon(b, pts); g.DrawPolygon(p, pts); b.Dispose(); p.Dispose(); } }
System.Object
Northwoods.Go.Draw.GoRulerCursor
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2