Exemplo n.º 1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            if (m_Words == null) { return; }
            if (m_Layout == null) { return; }

            IEnumerable<LayoutItem> wordsToRedraw = m_Layout.GetWordsInArea(e.ClipRectangle);
            using (Graphics graphics = e.Graphics)
            using (IGraphicEngine graphicEngine =
                    new GdiGraphicEngine(graphics, this.Font.FontFamily, FontStyle.Regular, m_Palette, MinFontSize, MaxFontSize, m_MinWordWeight, m_MaxWordWeight))
            {
                foreach (LayoutItem currentItem in wordsToRedraw)
                {
                    if (m_ItemUderMouse == currentItem)
                    {
                        graphicEngine.DrawEmphasized(currentItem);
                    }
                    else
                    {
                        graphicEngine.Draw(currentItem);                        
                    }
                }
            }
        }
Exemplo n.º 2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            if (m_Words == null)
            {
                return;
            }
            if (m_Layout == null)
            {
                return;
            }

            IEnumerable <LayoutItem> wordsToRedraw = m_Layout.GetWordsInArea(e.ClipRectangle);

            using (Graphics graphics = e.Graphics)
                using (IGraphicEngine graphicEngine =
                           new GdiGraphicEngine(graphics, this.Font.FontFamily, FontStyle.Regular, m_Palette, MinFontSize, MaxFontSize, m_MinWordWeight, m_MaxWordWeight))
                {
                    foreach (LayoutItem currentItem in wordsToRedraw)
                    {
                        if (m_ItemUderMouse == currentItem)
                        {
                            graphicEngine.DrawEmphasized(currentItem);
                        }
                        else
                        {
                            graphicEngine.Draw(currentItem);
                        }
                    }
                }
        }
Exemplo n.º 3
0
        private void BuildLayout()
        {
            if (m_Words == null) { return; }

            using (Graphics graphics = this.CreateGraphics())
            {
                IGraphicEngine graphicEngine =
                    new GdiGraphicEngine(graphics, this.Font.FontFamily, FontStyle.Regular, m_Palette, MinFontSize, MaxFontSize, m_MinWordWeight, m_MaxWordWeight);
                m_Layout = LayoutFactory.CrateLayout(m_LayoutType, this.Size);
                m_Layout.Arrange(m_Words, graphicEngine);
            }
        }
Exemplo n.º 4
0
        private void BuildLayout()
        {
            if (m_Words == null)
            {
                return;
            }

            using (Graphics graphics = this.CreateGraphics())
            {
                IGraphicEngine graphicEngine =
                    new GdiGraphicEngine(graphics, this.Font.FontFamily, FontStyle.Regular, m_Palette, MinFontSize, MaxFontSize, m_MinWordWeight, m_MaxWordWeight);
                m_Layout = LayoutFactory.CrateLayout(m_LayoutType, this.Size);
                m_Layout.Arrange(m_Words, graphicEngine);
            }
        }