1. 程式人生 > >System.Drawing.Text.TextRenderingHint 的幾種效果

System.Drawing.Text.TextRenderingHint 的幾種效果

sin style raw width roman per default type new

技術分享

            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 的幾種效果