/// <summary> /// paint line control /// </summary> /// <param name="g"></param> internal override void paintForeground(Graphics g, Rectangle rect, Color fgColor) { if (!Visible) { return; } Point pt1 = new Point(X1, Y1); Point pt2 = new Point(X2, Y2); #if PocketPC BasicControlsManager staticControlsManager = ContainerManager as BasicControlsManager; if (staticControlsManager != null) { Point offset = staticControlsManager.ContainerOffset(); pt1.Offset(offset.X, offset.Y); pt2.Offset(offset.X, offset.Y); } #endif ControlRenderer.PaintLineForeGround(g, fgColor, LineHelper.Style, LineHelper.LineWidth, LineHelper.LineStyle, pt1, pt2); }
/// <summary> /// Draw the control on the given Graphics at the specified rectangle. /// </summary> /// <param name="graphics"></param> /// <param name="rect"></param> public void Draw(Graphics graphics, Rectangle rect) { Point[] linePoints = LineRenderer.GetLinePoints(rect, lineWidth, directionOfLine); ControlRenderer.PaintLineForeGround(graphics, LineColor, ControlStyle, LineWidth, CtrlLineType, linePoints[0], linePoints[1]); }
/// <summary> /// Paint the line /// </summary> /// <param name="e"></param> protected override void OnPaint(PaintEventArgs e) { ControlRenderer.PaintLineForeGround(e.Graphics, LineColor, ControlStyle, LineWidth, CtrlLineType, StartPoint, EndPoint); }