public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityTrackable(trackingTimestamps, currentTimestamp);

            if (opacityFactor <= 0)
            {
                return;
            }

            Point start = transformer.Transform(points["a"]);
            Point end   = transformer.Transform(points["b"]);

            using (Pen penEdges = styleHelper.GetPen(opacityFactor, transformer.Scale))
                using (Brush brush = styleHelper.GetBrush(opacityFactor))
                {
                    if (distorter != null && distorter.Initialized)
                    {
                        DrawDistorted(canvas, distorter, transformer, penEdges, brush, start, end);
                    }
                    else
                    {
                        DrawStraight(canvas, transformer, penEdges, brush, start, end);
                    }
                }

            if (trackExtraData != TrackExtraData.None)
            {
                string text = GetExtraDataText();
                miniLabel.SetText(text);
                miniLabel.Draw(canvas, transformer, opacityFactor);
            }
        }
Ejemplo n.º 2
0
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityFactor(currentTimestamp);

            if (opacityFactor <= 0)
            {
                return;
            }

            QuadrilateralF quad = transformer.Transform(quadImage);

            int alpha = (int)(opacityFactor * 255);

            using (Pen p = styleHelper.GetPen(alpha, transformer.Scale))
            {
                p.EndCap = LineCap.Square;
                if (styleHelper.PenShape == PenShape.Dash)
                {
                    p.DashStyle = DashStyle.Dash;
                }

                canvas.DrawLine(p, quad.A, quad.B);
                canvas.DrawLine(p, quad.B, quad.C);
                canvas.DrawLine(p, quad.C, quad.D);
                canvas.DrawLine(p, quad.D, quad.A);
            }
        }
Ejemplo n.º 3
0
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityFactor(currentTimestamp);

            if (opacityFactor <= 0)
            {
                return;
            }

            int alpha = (int)(opacityFactor * 255);

            this.selected = selected;

            using (Pen p = styleHelper.GetPen(alpha, transformer.Scale))
            {
                Rectangle boundingBox = transformer.Transform(center.Box(radius));
                canvas.DrawEllipse(p, boundingBox);

                if (selected)
                {
                    // Handler: arc in lower right quadrant.
                    p.Color = p.Color.Invert();
                    canvas.DrawArc(p, boundingBox, 25, 40);
                }
            }
        }
Ejemplo n.º 4
0
        public override void Draw(Graphics _canvas, CoordinateSystem _transformer, bool _bSelected, long _iCurrentTimestamp)
        {
            double fOpacityFactor = m_InfosFading.GetOpacityFactor(_iCurrentTimestamp);

            if (fOpacityFactor <= 0)
            {
                return;
            }

            int alpha = (int)(fOpacityFactor * 255);

            m_bSelected = _bSelected;

            using (Pen p = m_StyleHelper.GetPen(alpha, _transformer.Scale))
            {
                Rectangle boundingBox = _transformer.Transform(m_Center.Box(m_iRadius));
                _canvas.DrawEllipse(p, boundingBox);

                if (_bSelected)
                {
                    // Handler: arc in lower right quadrant.
                    p.Color = p.Color.Invert();
                    _canvas.DrawArc(p, boundingBox, 25, 40);
                }
            }
        }
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityFactor(currentTimestamp);

            if (opacityFactor <= 0)
            {
                return;
            }

            using (Pen penLine = styleHelper.GetPen(opacityFactor, transformer.Scale))
            {
                Point[] points = transformer.Transform(pointList).ToArray();

                if (!initializing)
                {
                    penLine.EndCap   = LineCap.Round;
                    penLine.StartCap = LineCap.Round;

                    if (styleHelper.PenShape == PenShape.Dash)
                    {
                        penLine.DashStyle = DashStyle.Dash;
                    }

                    canvas.DrawCurve(penLine, points, 0.5f);
                }
                else
                {
                    penLine.Width = 1.0f;
                    canvas.DrawLines(penLine, points);
                }
            }
        }
Ejemplo n.º 6
0
        public override void Draw(Graphics _canvas, CoordinateSystem _transformer, bool _bSelected, long _iCurrentTimestamp)
        {
            double fOpacityFactor = m_InfosFading.GetOpacityFactor(_iCurrentTimestamp);

            if (fOpacityFactor <= 0)
            {
                return;
            }

            int   iAlpha = (int)(fOpacityFactor * 255);
            Point c      = _transformer.Transform(m_Center);

            using (Pen p = m_StyleHelper.GetPen(iAlpha))
                using (SolidBrush b = m_StyleHelper.GetBrush((int)(fOpacityFactor * m_iDefaultBackgroundAlpha)))
                {
                    _canvas.DrawLine(p, c.X - m_iDefaultRadius, c.Y, c.X + m_iDefaultRadius, c.Y);
                    _canvas.DrawLine(p, c.X, c.Y - m_iDefaultRadius, c.X, c.Y + m_iDefaultRadius);
                    _canvas.FillEllipse(b, c.Box(m_iDefaultRadius + 1));
                }

            if (m_bShowCoordinates)
            {
                m_LabelCoordinates.SetText(m_ParentMetadata.CalibrationHelper.GetPointText(m_Center, true));
                m_LabelCoordinates.Draw(_canvas, _transformer, fOpacityFactor);
            }
        }
Ejemplo n.º 7
0
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityFactor(currentTimestamp);

            if (tracking)
            {
                opacityFactor = 1.0;
            }

            if (opacityFactor <= 0)
            {
                return;
            }

            int   iAlpha = (int)(opacityFactor * 255);
            Point c      = transformer.Transform(points["0"]);

            using (Pen p = styleHelper.GetPen(iAlpha))
                using (SolidBrush b = styleHelper.GetBrush((int)(opacityFactor * defaultBackgroundAlpha)))
                {
                    canvas.DrawLine(p, c.X - defaultRadius, c.Y, c.X + defaultRadius, c.Y);
                    canvas.DrawLine(p, c.X, c.Y - defaultRadius, c.X, c.Y + defaultRadius);
                    canvas.FillEllipse(b, c.Box(defaultRadius + 1));
                }

            if (trackExtraData != TrackExtraData.None)
            {
                string text = GetExtraDataText(infosFading.ReferenceTimestamp);
                miniLabel.SetText(text);
                miniLabel.Draw(canvas, transformer, opacityFactor);
            }
        }
Ejemplo n.º 8
0
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityFactor(currentTimestamp);

            if (tracking)
            {
                opacityFactor = 1.0;
            }

            if (opacityFactor <= 0)
            {
                return;
            }

            int   iAlpha = (int)(opacityFactor * 255);
            Point c      = transformer.Transform(points["0"]);

            using (Pen p = styleHelper.GetPen(iAlpha))
                using (SolidBrush b = styleHelper.GetBrush((int)(opacityFactor * defaultBackgroundAlpha)))
                {
                    canvas.DrawLine(p, c.X - defaultRadius, c.Y, c.X + defaultRadius, c.Y);
                    canvas.DrawLine(p, c.X, c.Y - defaultRadius, c.X, c.Y + defaultRadius);
                    canvas.FillEllipse(b, c.Box(defaultRadius + 1));
                }

            if (ShowMeasurableInfo)
            {
                labelCoordinates.SetText(CalibrationHelper.GetPointText(new PointF(points["0"].X, points["0"].Y), true, true, infosFading.ReferenceTimestamp));
                labelCoordinates.Draw(canvas, transformer, opacityFactor);
            }
        }
Ejemplo n.º 9
0
        public override void Draw(Graphics _canvas, CoordinateSystem _transformer, bool _bSelected, long _iCurrentTimestamp)
        {
            double fOpacityFactor = m_InfosFading.GetOpacityFactor(_iCurrentTimestamp);

            if (fOpacityFactor <= 0)
            {
                return;
            }

            Quadrilateral quad = _transformer.Transform(m_Corners);

            using (m_PenEdges = m_StyleHelper.GetPen(fOpacityFactor, 1.0))
                using (SolidBrush br = m_StyleHelper.GetBrush(fOpacityFactor))
                {
                    // Handlers
                    foreach (Point p in quad)
                    {
                        _canvas.FillEllipse(br, p.Box(4));
                    }

                    // Grid
                    if (m_bValidPlane)
                    {
                        float[] homography = GetHomographyMatrix(quad.ToArray());

                        // Rows
                        for (int iRow = 0; iRow <= m_iDivisions; iRow++)
                        {
                            float  v  = (float)iRow / m_iDivisions;
                            PointF h1 = ProjectiveMapping(new PointF(0, v), homography);
                            PointF h2 = ProjectiveMapping(new PointF(1, v), homography);
                            _canvas.DrawLine(m_PenEdges, h1, h2);
                        }

                        // Columns
                        for (int iCol = 0; iCol <= m_iDivisions; iCol++)
                        {
                            float  h  = (float)iCol / m_iDivisions;
                            PointF h1 = ProjectiveMapping(new PointF(h, 0), homography);
                            PointF h2 = ProjectiveMapping(new PointF(h, 1), homography);
                            _canvas.DrawLine(m_PenEdges, h1, h2);
                        }
                    }
                    else
                    {
                        // Non convex quadrilateral: only draw the borders
                        _canvas.DrawLine(m_PenEdges, quad.A, quad.B);
                        _canvas.DrawLine(m_PenEdges, quad.B, quad.C);
                        _canvas.DrawLine(m_PenEdges, quad.C, quad.D);
                        _canvas.DrawLine(m_PenEdges, quad.D, quad.A);
                    }
                }
        }
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityFactor(currentTimestamp);

            if (opacityFactor <= 0)
            {
                return;
            }

            List <Point> screenPoints = transformer.Transform(points);

            using (penEdges = styleHelper.GetPen(opacityFactor, 1.0))
                using (SolidBrush br = styleHelper.GetBrush(opacityFactor))
                {
                    int rows = subdivisions + 1;
                    int cols = rows;

                    // Rows
                    for (int i = 0; i < rows; i++)
                    {
                        int          row  = i;
                        List <Point> line = new List <Point>();
                        for (int j = 0; j < cols; j++)
                        {
                            int index = row * cols + j;
                            line.Add(screenPoints[index]);
                        }

                        canvas.DrawCurve(penEdges, line.ToArray());
                    }

                    // Columns
                    for (int i = 0; i < cols; i++)
                    {
                        int          col  = i;
                        List <Point> line = new List <Point>();
                        for (int j = 0; j < rows; j++)
                        {
                            int index = j * cols + col;
                            line.Add(screenPoints[index]);
                        }

                        canvas.DrawCurve(penEdges, line.ToArray());
                    }

                    // Handles
                    foreach (PointF p in screenPoints)
                    {
                        canvas.FillEllipse(br, p.Box(4));
                    }
                }
        }
Ejemplo n.º 11
0
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double fOpacityFactor = infosFading.GetOpacityFactor(currentTimestamp);

            if (fOpacityFactor <= 0)
            {
                return;
            }

            using (Pen penLine = styleHelper.GetPen(fOpacityFactor, transformer.Scale))
            {
                Point[] points = transformer.Transform(pointList).ToArray();
                canvas.DrawCurve(penLine, points, 0.5f);
            }
        }
Ejemplo n.º 12
0
        public override void Draw(Graphics _canvas, CoordinateSystem _transformer, bool _bSelected, long _iCurrentTimestamp)
        {
            double fOpacityFactor = m_InfosFading.GetOpacityFactor(_iCurrentTimestamp);

            if (fOpacityFactor <= 0)
            {
                return;
            }

            using (Pen penLine = m_StyleHelper.GetPen(fOpacityFactor, _transformer.Scale))
            {
                Point[] points = m_PointList.Select(p => _transformer.Transform(p)).ToArray();
                _canvas.DrawCurve(penLine, points, 0.5f);
            }
        }
Ejemplo n.º 13
0
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacity = infosFading.GetOpacityFactor(currentTimestamp);

            if (opacity <= 0)
            {
                return;
            }

            //int backgroundOpacity = editing ? 255 : 192;
            int backgroundOpacity = 255;

            using (SolidBrush brushBack = styleHelper.GetBackgroundBrush((int)(opacity * backgroundOpacity)))
                using (SolidBrush brushText = styleHelper.GetForegroundBrush((int)(opacity * 255)))
                    using (Pen pen = styleHelper.GetPen(backgroundOpacity))
                        using (Font fontText = styleHelper.GetFont((float)transformer.Scale))
                        {
                            SizeF textSize   = canvas.MeasureString(text, fontText);
                            Point bgLocation = transformer.Transform(background.Rectangle.Location);
                            Size  bgSize     = new Size((int)textSize.Width, (int)textSize.Height);

                            SizeF untransformed = transformer.Untransform(textSize);
                            background.Rectangle = new RectangleF(background.Rectangle.Location, untransformed);

                            Rectangle rect           = new Rectangle(bgLocation, bgSize);
                            int       roundingRadius = fontText.Height / 4;

                            if (showArrow)
                            {
                                pen.Color = brushBack.Color;
                                pen.Width = fontText.Height / 4;
                                Point arrowStartInScreen = rect.Center();
                                Point arrowEndInScreen   = transformer.Transform(arrowEnd);
                                canvas.DrawLine(pen, arrowStartInScreen, arrowEndInScreen);
                                ArrowHelper.Draw(canvas, pen, arrowEndInScreen, arrowStartInScreen);
                            }

                            RoundedRectangle.Draw(canvas, rect, brushBack, roundingRadius, false, false, null);

                            if (!editing)
                            {
                                canvas.DrawString(text, fontText, brushText, rect.Location);
                            }
                        }
        }
Ejemplo n.º 14
0
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityTrackable(trackingTimestamps, currentTimestamp);

            if (opacityFactor <= 0)
            {
                return;
            }

            QuadrilateralF quad = transformer.Transform(quadImage);

            bool drawEdgesOnly = !planeIsConvex || (!styleHelper.Perspective && !quadImage.IsAxisAlignedRectangle);

            using (penEdges = styleHelper.GetPen(opacityFactor, 1.0))
                using (SolidBrush br = styleHelper.GetBrush(opacityFactor))
                {
                    foreach (PointF p in quad)
                    {
                        canvas.FillEllipse(br, p.Box(4));
                    }

                    if (!drawEdgesOnly)
                    {
                        if (distorter != null && distorter.Initialized)
                        {
                            QuadrilateralF undistortedQuadImage = distorter.Undistort(quadImage);
                            projectiveMapping.Update(quadPlane, undistortedQuadImage);
                        }
                        else
                        {
                            projectiveMapping.Update(quadPlane, quadImage);
                        }

                        DrawGrid(canvas, penEdges, projectiveMapping, distorter, transformer);
                    }
                    else
                    {
                        // Non convex quadrilateral or non rectangle 2d grid: only draw the edges.
                        canvas.DrawLine(penEdges, quad.A, quad.B);
                        canvas.DrawLine(penEdges, quad.B, quad.C);
                        canvas.DrawLine(penEdges, quad.C, quad.D);
                        canvas.DrawLine(penEdges, quad.D, quad.A);
                    }
                }
        }
Ejemplo n.º 15
0
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityFactor(currentTimestamp);

            if (opacityFactor <= 0)
            {
                return;
            }

            QuadrilateralF quad = transformer.Transform(quadImage);

            using (penEdges = styleHelper.GetPen(opacityFactor, 1.0))
                using (SolidBrush br = styleHelper.GetBrush(opacityFactor))
                {
                    foreach (PointF p in quad)
                    {
                        canvas.FillEllipse(br, p.Box(4));
                    }

                    if (planeIsConvex)
                    {
                        if (distorter != null && distorter.Initialized)
                        {
                            QuadrilateralF undistortedQuadImage = distorter.Undistort(quadImage);
                            projectiveMapping.Update(quadPlane, undistortedQuadImage);
                        }
                        else
                        {
                            projectiveMapping.Update(quadPlane, quadImage);
                        }

                        //DrawDiagonals(canvas, penEdges, quadPlane, projectiveMapping, distorter, transformer);
                        DrawGrid(canvas, penEdges, projectiveMapping, distorter, transformer);
                    }
                    else
                    {
                        // Non convex quadrilateral: only draw the edges.
                        canvas.DrawLine(penEdges, quad.A, quad.B);
                        canvas.DrawLine(penEdges, quad.B, quad.C);
                        canvas.DrawLine(penEdges, quad.C, quad.D);
                        canvas.DrawLine(penEdges, quad.D, quad.A);
                    }
                }
        }
Ejemplo n.º 16
0
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityFactor(currentTimestamp);

            if (tracking)
            {
                opacityFactor = 1.0;
            }

            if (opacityFactor <= 0)
            {
                return;
            }

            Point start = transformer.Transform(points["a"]);
            Point end   = transformer.Transform(points["b"]);

            using (Pen penEdges = styleHelper.GetPen((int)(opacityFactor * 255), transformer.Scale))
            {
                if (distorter != null && distorter.Initialized)
                {
                    DrawDistorted(canvas, distorter, transformer, penEdges, start, end);
                }
                else
                {
                    DrawStraight(canvas, transformer, penEdges, start, end);
                }
            }

            if (ShowMeasurableInfo)
            {
                // Text of the measure. (The helpers knows the unit)
                PointF a = new PointF(points["a"].X, points["a"].Y);
                PointF b = new PointF(points["b"].X, points["b"].Y);
                labelMeasure.SetText(CalibrationHelper.GetLengthText(a, b, true, true));
                labelMeasure.Draw(canvas, transformer, opacityFactor);
            }
        }
Ejemplo n.º 17
0
        public override void Draw(Graphics _canvas, CoordinateSystem _transformer, bool _bSelected, long _iCurrentTimestamp)
        {
            double fOpacityFactor = m_InfosFading.GetOpacityFactor(_iCurrentTimestamp);

            if (fOpacityFactor <= 0)
            {
                return;
            }

            Point start = _transformer.Transform(m_StartPoint);
            Point end   = _transformer.Transform(m_EndPoint);

            using (Pen penEdges = m_StyleHelper.GetPen((int)(fOpacityFactor * 255), _transformer.Scale))
            {
                _canvas.DrawLine(penEdges, start, end);

                // Handlers
                penEdges.Width = _bSelected ? 2 : 1;
                if (m_StyleHelper.LineEnding.StartCap != LineCap.ArrowAnchor)
                {
                    _canvas.DrawEllipse(penEdges, start.Box(3));
                }

                if (m_StyleHelper.LineEnding.EndCap != LineCap.ArrowAnchor)
                {
                    _canvas.DrawEllipse(penEdges, end.Box(3));
                }
            }

            if (m_bShowMeasure)
            {
                // Text of the measure. (The helpers knows the unit)
                m_LabelMeasure.SetText(m_ParentMetadata.CalibrationHelper.GetLengthText(m_StartPoint, m_EndPoint));
                m_LabelMeasure.Draw(_canvas, _transformer, fOpacityFactor);
            }
        }
Ejemplo n.º 18
0
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityFactor(currentTimestamp);

            if (tracking)
            {
                opacityFactor = 1.0;
            }

            if (opacityFactor <= 0)
            {
                return;
            }

            if (points.Count < 2)
            {
                return;
            }

            Point[] pointList = transformer.Transform(points.Values).ToArray();

            using (Pen penEdges = styleHelper.GetPen((int)(opacityFactor * 255), transformer.Scale))
            {
                PointF danglingStart;
                PointF danglingEnd;

                if (initializing)
                {
                    danglingStart = pointList[pointList.Length - 2];
                    danglingEnd   = pointList[pointList.Length - 1];

                    penEdges.DashStyle = DashStyle.Dot;
                    canvas.DrawLine(penEdges, danglingStart, danglingEnd);

                    if (pointList.Length > 2)
                    {
                        Point[] path = pointList.TakeWhile((p, i) => i <= pointList.Length - 2).ToArray();
                        DrawPath(canvas, penEdges, path);
                    }
                }
                else
                {
                    Point[] path = pointList.ToArray();
                    DrawPath(canvas, penEdges, path);
                }

                if (styleHelper.LineEnding == LineEnding.StartArrow || styleHelper.LineEnding == LineEnding.DoubleArrow)
                {
                    ArrowHelper.Draw(canvas, penEdges, pointList[0], pointList[1]);
                }

                if (styleHelper.LineEnding == LineEnding.EndArrow || styleHelper.LineEnding == LineEnding.DoubleArrow)
                {
                    ArrowHelper.Draw(canvas, penEdges, pointList[pointList.Length - 1], pointList[pointList.Length - 2]);
                }

                // Handlers
                if (selected)
                {
                    penEdges.Width = 2;
                    foreach (PointF p in pointList)
                    {
                        canvas.FillEllipse(penEdges.Brush, p.Box(3));
                    }
                }
            }
        }
Ejemplo n.º 19
0
        public override void Draw(Graphics canvas, DistortionHelper distorter, IImageToViewportTransformer transformer, bool selected, long currentTimestamp)
        {
            double opacityFactor = infosFading.GetOpacityFactor(currentTimestamp);

            if (opacityFactor <= 0)
            {
                return;
            }

            int alpha = (int)(opacityFactor * 255);

            using (Pen p = styleHelper.GetPen(alpha, transformer.Scale))
            {
                if (styleHelper.PenShape == PenShape.Dash)
                {
                    p.DashStyle = DashStyle.Dash;
                }

                // The center of the original circle is still the correct center even in perspective.
                PointF circleCenter = transformer.Transform(center);
                DrawCenter(canvas, p, circleCenter.ToPoint());

                if (CalibrationHelper.CalibratorType == CalibratorType.Plane)
                {
                    // Draw the circle in perspective.
                    PointF     ellipseCenter = transformer.Transform(ellipseInImage.Center);
                    float      semiMinorAxis = transformer.Transform((int)ellipseInImage.SemiMinorAxis);
                    float      semiMajorAxis = transformer.Transform((int)ellipseInImage.SemiMajorAxis);
                    Ellipse    ellipse       = new Ellipse(ellipseCenter, semiMajorAxis, semiMinorAxis, ellipseInImage.Rotation);
                    RectangleF rect          = new RectangleF(-ellipse.SemiMajorAxis, -ellipse.SemiMinorAxis, ellipse.SemiMajorAxis * 2, ellipse.SemiMinorAxis * 2);
                    float      angle         = (float)(ellipse.Rotation * MathHelper.RadiansToDegrees);

                    canvas.TranslateTransform(ellipse.Center.X, ellipse.Center.Y);
                    canvas.RotateTransform(angle);

                    canvas.DrawEllipse(p, rect);

                    canvas.RotateTransform(-angle);
                    canvas.TranslateTransform(-ellipse.Center.X, -ellipse.Center.Y);
                }
                else
                {
                    Rectangle boundingBox = transformer.Transform(center.Box(radius));
                    canvas.DrawEllipse(p, boundingBox);
                }

                if (trackExtraData != TrackExtraData.None)
                {
                    // Draw lines from the center to the periphery of the circle to show the radius or diameter.
                    if (trackExtraData == TrackExtraData.Radius)
                    {
                        PointF radiusRight = transformer.Transform(radiusRightInImage);
                        canvas.DrawLine(p, circleCenter, radiusRight);
                    }
                    else if (trackExtraData == TrackExtraData.Diameter)
                    {
                        PointF radiusLeft  = transformer.Transform(radiusLeftInImage);
                        PointF radiusRight = transformer.Transform(radiusRightInImage);
                        canvas.DrawLine(p, radiusLeft, radiusRight);
                    }

                    string text = GetExtraDataText(infosFading.ReferenceTimestamp);
                    miniLabel.SetText(text);
                    miniLabel.Draw(canvas, transformer, opacityFactor);
                }
            }
        }