码迷,mamicode.com
首页 > Windows程序 > 详细

System.Drawing.Text.TextRenderingHint 的几种效果

时间:2017-11-07 13:23:10      阅读:309      评论:0      收藏:0      [点我收藏+]

标签:anti   image   font   log   bsp   效果   emd   pixel   测试   

 

技术分享

 

            for (int i = 0; i < 6; i++)
            {
                g5.TextRenderingHint = (System.Drawing.Text.TextRenderingHint)i;
                string txt;
                int font_sz = 25;

                txt = "Static 测试 ";
                switch ((System.Drawing.Text.TextRenderingHint)i)
                {
                    case System.Drawing.Text.TextRenderingHint.SystemDefault:
                        txt += "SystemDefault";
                        g5.DrawString(txt, new Font("Times New Roman", font_sz), new SolidBrush(Color.Black),
                            new PointF(this._parentControl.Width - 400, 30 + 35 * i));
                        break;
                    case System.Drawing.Text.TextRenderingHint.AntiAlias:
                        txt += "AntiAlias";
                        g5.DrawString(txt, new Font("Times New Roman", font_sz), new SolidBrush(Color.Black),
                            new PointF(this._parentControl.Width - 400, 30 + 35 * i));
                        break;
                    case System.Drawing.Text.TextRenderingHint.AntiAliasGridFit:
                        txt += "AntiAliasGridFit";
                        g5.DrawString(txt, new Font("Times New Roman", font_sz), new SolidBrush(Color.Black),
                            new PointF(this._parentControl.Width - 400, 30 + 35 * i));
                        break;
                    case System.Drawing.Text.TextRenderingHint.ClearTypeGridFit:
                        txt += "ClearTypeGridFit";
                        g5.DrawString(txt, new Font("Times New Roman", font_sz), new SolidBrush(Color.Black),
                            new PointF(this._parentControl.Width - 400, 30 + 35 * i));
                        break;
                    case System.Drawing.Text.TextRenderingHint.SingleBitPerPixel:
                        txt += "SingleBitPerPixel";
                        g5.DrawString(txt, new Font("Times New Roman", font_sz), new SolidBrush(Color.Black),
                            new PointF(this._parentControl.Width - 400, 30 + 35 * i));
                        break;
                    case System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit:
                        txt += "SingleBitPerPixelGridFit";
                        g5.DrawString(txt, new Font("Times New Roman", font_sz), new SolidBrush(Color.Black),
                            new PointF(this._parentControl.Width - 400, 30 + 35 * i));
                        break;
                    default:
                        break;
                }
            }

 

System.Drawing.Text.TextRenderingHint 的几种效果

标签:anti   image   font   log   bsp   效果   emd   pixel   测试   

原文地址:http://www.cnblogs.com/arxive/p/7798327.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!