Esempio n. 1
0
        public DrawingLine(PointF origin, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null, IImageToViewportTransformer transformer = null)
        {
            points["a"]  = origin;
            points["b"]  = origin.Translate(10, 0);
            labelMeasure = new KeyframeLabel(GetMiddlePoint(), Color.Black, transformer);

            styleHelper.Color    = Color.DarkSlateGray;
            styleHelper.LineSize = 1;

            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Line");
            }

            style = preset.Clone();
            BindStyle();

            // Fading
            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);

            // Context menu
            mnuShowMeasure.Click += mnuShowMeasure_Click;
            mnuShowMeasure.Image  = Properties.Drawings.measure;
            mnuSealMeasure.Click += mnuSealMeasure_Click;
            mnuSealMeasure.Image  = Properties.Drawings.linecalibrate;
        }
Esempio n. 2
0
        public static KeyframeLabel FromXml(XmlTextReader _xmlReader, bool _relative, PointF _scale)
        {
            // Read all tags between <KeyframeLabel> and </KeyframeLabel> and fills up an object.

            KeyframeLabel kfl = new KeyframeLabel(_relative, Color.Black);

            while (_xmlReader.Read())
            {
                if (_xmlReader.IsStartElement())
                {
                    if (_xmlReader.Name == "SpacePosition")
                    {
                        Point p       = XmlHelper.PointParse(_xmlReader.ReadString(), ';');
                        Point adapted = new Point((int)((float)p.X * _scale.X), (int)((float)p.Y * _scale.Y));

                        kfl.Background         = new Rectangle(adapted, new Size(10, 10));
                        kfl.RescaledBackground = new Rectangle(adapted, new Size(10, 10));
                    }
                    else if (_xmlReader.Name == "TimePosition")
                    {
                        // Time was stored absolute.
                        kfl.m_iTimestamp = long.Parse(_xmlReader.ReadString());
                    }
                    else if (_xmlReader.Name == "TextDecoration")
                    {
                        kfl.m_TextDecoration = InfosTextDecoration.FromXml(_xmlReader);
                    }

                    /*else if (_xmlReader.Name == "BackgroundBrush")
                     * {
                     *  ParseBackgroundBrush(_xmlReader, kfl);
                     * }
                     * else if (_xmlReader.Name == "Font")
                     * {
                     *  ParseFont(_xmlReader, kfl);
                     * }*/
                    else
                    {
                        // forward compatibility : ignore new fields.
                    }
                }
                else if (_xmlReader.Name == "KeyframeLabel")
                {
                    break;
                }
                else
                {
                    // Fermeture d'un tag interne.
                }
            }

            return(kfl);
        }
Esempio n. 3
0
        public DrawingCross2D(Point _center, long _iTimestamp, long _iAverageTimeStampsPerFrame, DrawingStyle _preset)
        {
            m_Center           = _center;
            m_LabelCoordinates = new KeyframeLabel(m_Center, Color.Black);

            // Decoration & binding with editors
            m_StyleHelper.Color = Color.CornflowerBlue;
            if (_preset != null)
            {
                m_Style = _preset.Clone();
                BindStyle();
            }

            m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame);

            // Context menu
            mnuShowCoordinates.Click += new EventHandler(mnuShowCoordinates_Click);
            mnuShowCoordinates.Image  = Properties.Drawings.measure;
        }
Esempio n. 4
0
        public DrawingCrossMark(PointF center, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset, IImageToViewportTransformer transformer)
        {
            points["0"]      = center;
            labelCoordinates = new KeyframeLabel(points["0"], Color.Black, transformer);

            // Decoration & binding with editors
            styleHelper.Color = Color.CornflowerBlue;
            if (preset != null)
            {
                style = preset.Clone();
                BindStyle();
            }

            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);

            // Context menu
            mnuShowCoordinates.Click += new EventHandler(mnuShowCoordinates_Click);
            mnuShowCoordinates.Image  = Properties.Drawings.measure;
        }
Esempio n. 5
0
        public DrawingLine2D(Point _start, Point _end, long _iTimestamp, long _iAverageTimeStampsPerFrame, DrawingStyle _preset)
        {
            m_StartPoint   = _start;
            m_EndPoint     = _end;
            m_LabelMeasure = new KeyframeLabel(GetMiddlePoint(), Color.Black);

            // Decoration
            m_StyleHelper.Color    = Color.DarkSlateGray;
            m_StyleHelper.LineSize = 1;
            if (_preset != null)
            {
                m_Style = _preset.Clone();
                BindStyle();
            }

            // Fading
            m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame);

            // Context menu
            mnuShowMeasure.Click += new EventHandler(mnuShowMeasure_Click);
            mnuShowMeasure.Image  = Properties.Drawings.measure;
            mnuSealMeasure.Click += new EventHandler(mnuSealMeasure_Click);
            mnuSealMeasure.Image  = Properties.Drawings.linecalibrate;
        }