コード例 #1
0
ファイル: DrawingText.cs プロジェクト: jfpk/kinoveaIDS
        public DrawingText(PointF p, long timestamp, long averageTimeStampsPerFrame, DrawingStyle stylePreset)
        {
            text = " ";
            background.Rectangle = new RectangleF(p, SizeF.Empty);

            styleHelper.Bicolor = new Bicolor(Color.Black);
            styleHelper.Font    = new Font("Arial", defaultFontSize, FontStyle.Bold);

            if (stylePreset != null)
            {
                style = stylePreset.Clone();
                BindStyle();
            }

            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);
            editing     = false;

            textBox = new TextBox()
            {
                Visible     = false,
                BackColor   = Color.White,
                BorderStyle = BorderStyle.None,
                Multiline   = true,
                Text        = text,
                Font        = styleHelper.GetFontDefaultSize(defaultFontSize)
            };

            textBox.TextChanged += TextBox_TextChanged;
            UpdateLabelRectangle();
        }
コード例 #2
0
        public DrawingText(Point p, long _iTimestamp, long _iAverageTimeStampsPerFrame, DrawingStyle _preset)
        {
            m_Text = " ";
            m_Background.Rectangle = new Rectangle(p, Size.Empty);

            // Decoration & binding with editors
            m_StyleHelper.Bicolor = new Bicolor(Color.Black);
            m_StyleHelper.Font    = new Font("Arial", m_iDefaultFontSize, FontStyle.Bold);
            if (_preset != null)
            {
                m_Style = _preset.Clone();
                BindStyle();
            }

            m_InfosFading = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame);
            m_bEditMode   = false;

            m_TextBox = new TextBox()
            {
                Visible     = false,
                BackColor   = Color.White,
                BorderStyle = BorderStyle.None,
                Multiline   = true,
                Text        = m_Text,
                Font        = m_StyleHelper.GetFontDefaultSize(m_iDefaultFontSize)
            };

            m_TextBox.TextChanged += new EventHandler(TextBox_TextChanged);

            UpdateLabelRectangle();
        }
コード例 #3
0
ファイル: DrawingText.cs プロジェクト: sandeepbeniwal/Kinovea
        public DrawingText(PointF p, long timestamp, long averageTimeStampsPerFrame, DrawingStyle preset = null)
        {
            text = "";
            background.Rectangle = new RectangleF(p, SizeF.Empty);
            arrowEnd             = p.Translate(-50, -50);
            showArrow            = false;

            styleHelper.Bicolor = new Bicolor(Color.Black);
            styleHelper.Font    = new Font("Arial", defaultFontSize, FontStyle.Bold);
            if (preset == null)
            {
                preset = ToolManager.GetStylePreset("Label");
            }

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

            infosFading = new InfosFading(timestamp, averageTimeStampsPerFrame);
            editing     = false;

            fontText = styleHelper.GetFontDefaultSize(defaultFontSize);

            textBox = new TextBox()
            {
                Visible     = false,
                BackColor   = Color.White,
                BorderStyle = BorderStyle.None,
                Multiline   = true,
                Text        = text,
                Font        = fontText
            };

            textBox.Margin    = new Padding(0, 0, 0, 0);
            textBox.TextAlign = HorizontalAlignment.Left;
            textBox.WordWrap  = false;

            textBox.TextChanged += TextBox_TextChanged;
            UpdateLabelRectangle();

            mnuShowArrow.Click += new EventHandler(mnuShowArrow_Click);
            mnuShowArrow.Image  = Properties.Drawings.arrow;
        }