初探C#中Graphic的描画函数

来源:互联网 发布:网络优化工程师干嘛的 编辑:程序博客网 时间:2024/04/28 20:33

protected override void OnPaint(PaintEventArgs e)

        {

            base.OnPaint(e);

            /*paint the blue title*/

            using (SolidBrush b = new SolidBrush(Color.FromArgb(45,65,161)))

            {

                Rectangle title = new Rectangle(1, 1, this.Size.Width, 22);

                e.Graphics.FillRectangle(b, title);

            }

            m_NormalBorderColor.DrawBorder(e.Graphics, this.ClientRectangle);

            (new BMBiFontTextRenderer(

                new FontGroup(

                    new Font("Arial", 16F, FontStyle.Bold, GraphicsUnit.Pixel),

                    new Font("MS Gothic", 16F, FontStyle.Bold, GraphicsUnit.Pixel)),

                Color.White,

                TextHAlign.LEFT, 14, TextVAlign.TOP, 3)).DrawText("緊急検査", e.Graphics, new Rectangle(0, 0, 102, 20), new Size(0, 0), true);

           

        }

原创粉丝点击