public static void DrawArrowEnd(Graphics g, PointF a1, PointF a2, Color clr, float arrowSize) { Brush b = GVGraphics.GetBrush(clr); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; double angle = -Math.Atan2(a2.Y - a1.Y, a2.X - a1.X); PointF p1 = new PointF(a2.X - (float)(Math.Cos(angle - Math.PI / 8.0) * arrowSize), a2.Y + (float)(Math.Sin(angle - Math.PI / 8.0) * arrowSize)); PointF p2 = a2; PointF p3 = new PointF(a2.X - (float)(Math.Cos(angle + Math.PI / 8.0) * arrowSize), a2.Y + (float)(Math.Sin(angle + Math.PI / 8.0) * arrowSize)); g.FillPolygon(b, new PointF[] { p1, p2, p3 }); }
public virtual Brush GetBackgroundBrush() { if (StatusHighlighted) { switch (ClickType) { case GVObjectTrackerType.Click: return(GVGraphics.GetBrush(Color.CadetBlue)); case GVObjectTrackerType.DragDrop: return(GVGraphics.GetBrush(Color.MediumSeaGreen)); case GVObjectTrackerType.Switch: return(GVGraphics.GetBrush(Color.MediumVioletRed)); default: return(GVGraphics.GetBrush(Color.White)); } } else { switch (ClickType) { case GVObjectTrackerType.Click: return(GVGraphics.GetBrush(Color.Teal)); case GVObjectTrackerType.DragDrop: return(GVGraphics.GetBrush(Color.SeaGreen)); case GVObjectTrackerType.Switch: return(GVGraphics.GetBrush(Color.Purple)); default: return(GVGraphics.GetBrush(Color.Gray)); } } }