コード例 #1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

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

            IEnumerable <LayoutItem> termsToRedraw = m_Layout.GetTermsInArea(e.ClipRectangle);
            int a = termsToRedraw.Count();

            using (Graphics graphics = e.Graphics)
                using (IGraphicEngine graphicEngine =
                           new GdiGraphicEngine(graphics, this.Font.FontFamily, FontStyle.Regular, m_Palette, MinFontSize, MaxFontSize, m_MinTermWeight, m_MaxTermWeight))
                {
                    foreach (LayoutItem currentItem in termsToRedraw)
                    {
                        if (m_ItemUderMouse == currentItem)
                        {
                            graphicEngine.DrawEmphasized(currentItem);
                        }
                        else
                        {
                            graphicEngine.Draw(currentItem);
                        }
                    }
                }
        }
コード例 #2
0
        private void BuildLayout()
        {
            if (m_Terms == null)
            {
                return;
            }

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