public static void DrawDropdownButton(Graphics g, Rectangle rect, bool isPressed) { GraphicsToolkit.Draw3DButton(g, rect, isPressed); // arrow int sx = rect.Left + (rect.Width - 9) / 2; GraphicsToolkit.FillTriangle(g, 9, new Point(sx, rect.Top + 7 + (isPressed ? 1 : 0))); }
public static Point PointAtArc(Rectangle rect, RGFloat angle) { RGFloat radians = (RGFloat)((GraphicsToolkit.AngleToArc( rect.Width, rect.Height, angle)) * PIAngleDelta); RGFloat ww = rect.Width / 2; RGFloat hh = rect.Height / 2; RGFloat x = (RGFloat)Math.Sin(radians) * ww; RGFloat y = (RGFloat)Math.Cos(radians) * hh; return(new Point(rect.X + ww + x, rect.Y + hh - y)); }
public static RangeHandlerPos InRangeHandler(Rectangle[] hands, Point p) { if (hands == null) { return(RangeHandlerPos.None); } for (int i = 0; i < hands.Length; i++) { Rectangle rect = hands[i]; if (GraphicsToolkit.PointInRect(rect, p)) { return((RangeHandlerPos)i); } } return(RangeHandlerPos.None); }