public override void Draw(Graphics _canvas, double _fStretchFactor, bool _bSelected, long _iCurrentTimestamp, Point _DirectZoomTopLeft) { double fOpacityFactor = m_InfosFading.GetOpacityFactor(_iCurrentTimestamp); int iPenAlpha = (int)((double)255 * fOpacityFactor); if (iPenAlpha > 0) { // Rescale the points. m_fStretchFactor = _fStretchFactor; m_DirectZoomTopLeft = new Point(_DirectZoomTopLeft.X, _DirectZoomTopLeft.Y); RescaleCoordinates(m_fStretchFactor, m_DirectZoomTopLeft); float fPenWidth = (float)((double)m_PenStyle.Size * m_fStretchFactor); if (fPenWidth < 1) { fPenWidth = 1; } Pen penLine = m_PenStyle.GetInternalPen(iPenAlpha, fPenWidth); Point[] points = new Point[m_RescaledPointList.Count]; for (int i = 0; i < points.Length; i++) { points[i] = new Point(m_RescaledPointList[i].X, m_RescaledPointList[i].Y); } _canvas.DrawCurve(penLine, points, 0.5f); } }
public override void Draw(Graphics _canvas, double _fStretchFactor, bool _bSelected, long _iCurrentTimestamp, Point _DirectZoomTopLeft) { double fOpacityFactor = m_InfosFading.GetOpacityFactor(_iCurrentTimestamp); int iPenAlpha = (int)((double)255 * fOpacityFactor); if (iPenAlpha > 0) { m_fStretchFactor = _fStretchFactor; m_DirectZoomTopLeft = new Point(_DirectZoomTopLeft.X, _DirectZoomTopLeft.Y); RescaleCoordinates(m_fStretchFactor, m_DirectZoomTopLeft); Pen penEdges = m_PenStyle.GetInternalPen(iPenAlpha); _canvas.DrawLine(penEdges, m_RescaledStartPoint.X, m_RescaledStartPoint.Y, m_RescaledEndPoint.X, m_RescaledEndPoint.Y); // Handlers penEdges.Width = 1; if (_bSelected) { penEdges.Width++; } if (m_PenStyle.Shape == LineShape.Simple) { _canvas.DrawEllipse(penEdges, GetRescaledHandleRectangle(1)); _canvas.DrawEllipse(penEdges, GetRescaledHandleRectangle(2)); } else if (m_PenStyle.Shape == LineShape.EndArrow) { _canvas.DrawEllipse(penEdges, GetRescaledHandleRectangle(1)); } if (m_bShowMeasure) { // Text of the measure. (The helpers knows the unit) string text = m_ParentMetadata.CalibrationHelper.GetLengthText(m_StartPoint, m_EndPoint); m_LabelMeasure.TextInfos[0] = text; SetMeasureLabelConnector(); m_LabelMeasure.ResetBackground(_fStretchFactor, _DirectZoomTopLeft); // Draw. m_LabelMeasure.Draw(_canvas, fOpacityFactor); } } }
public override void Draw(Graphics _canvas, double _fStretchFactor, bool _bSelected, long _iCurrentTimestamp, Point _DirectZoomTopLeft) { double fOpacityFactor = m_InfosFading.GetOpacityFactor(_iCurrentTimestamp); int iPenAlpha = (int)((double)255 * fOpacityFactor); if (iPenAlpha > 0) { // Rescale the points. m_fStretchFactor = _fStretchFactor; m_DirectZoomTopLeft = new Point(_DirectZoomTopLeft.X, _DirectZoomTopLeft.Y); RescaleCoordinates(m_fStretchFactor, m_DirectZoomTopLeft); // Cross Pen PenEdges = m_PenStyle.GetInternalPen(iPenAlpha); //new Pen(Color.FromArgb(iPenAlpha, PenColor), 1); _canvas.DrawLine(PenEdges, RescaledCenterPoint.X - m_iDefaultRadius, RescaledCenterPoint.Y, RescaledCenterPoint.X + m_iDefaultRadius, RescaledCenterPoint.Y); _canvas.DrawLine(PenEdges, RescaledCenterPoint.X, RescaledCenterPoint.Y - m_iDefaultRadius, RescaledCenterPoint.X, RescaledCenterPoint.Y + m_iDefaultRadius); // Background _canvas.FillEllipse(new SolidBrush(Color.FromArgb((int)((double)m_iDefaultBackgroundAlpha * fOpacityFactor), m_PenStyle.Color)), RescaledCenterPoint.X - m_iDefaultRadius - 1, RescaledCenterPoint.Y - m_iDefaultRadius - 1, (m_iDefaultRadius * 2) + 2, (m_iDefaultRadius * 2) + 2); } }