Graphics.TextRenderingHint : Graphics « System.Drawing « C# / C Sharp by API

Home
C# / C Sharp by API
1.Microsoft.Win32
2.System
3.System.Collections
4.System.Collections.Generic
5.System.Collections.Specialized
6.System.ComponentModel
7.System.Configuration
8.System.Data
9.System.Data.Common
10.System.Data.Linq
11.System.Data.Odbc
12.System.Data.OleDb
13.System.Data.Sql
14.System.Data.SqlClient
15.System.Diagnostics
16.System.DirectoryServices
17.System.Drawing
18.System.Drawing.Drawing2D
19.System.Drawing.Imaging
20.System.Drawing.Printing
21.System.Drawing.Text
22.System.EnterpriseServices
23.System.Globalization
24.System.IO
25.System.IO.Compression
26.System.IO.IsolatedStorage
27.System.IO.Ports
28.System.Linq
29.System.Management
30.System.Media
31.System.Messaging
32.System.Net
33.System.Net.Mail
34.System.Net.NetworkInformation
35.System.Net.Sockets
36.System.Reflection
37.System.Resources
38.System.Runtime
39.System.Runtime.CompilerServices
40.System.Runtime.InteropServices
41.System.Runtime.Remoting
42.System.Runtime.Remoting.Channels
43.System.Runtime.Remoting.Channels.Http
44.System.Runtime.Remoting.Messaging
45.System.Runtime.Serialization
46.System.Runtime.Serialization.Formatters.Binary
47.System.Runtime.Serialization.Formatters.Soap
48.System.Security
49.System.Security.AccessControl
50.System.Security.Cryptography
51.System.Security.Cryptography.X509Certificates
52.System.Security.Permissions
53.System.Security.Policy
54.System.Security.Principal
55.System.ServiceProcess
56.System.Text
57.System.Text.RegularExpressions
58.System.Threading
59.System.Timers
60.System.Web.Security
61.System.Web.Services
62.System.Windows.Controls
63.System.Windows.Forms
64.System.Xml
65.System.Xml.Linq
66.System.Xml.Schema
67.System.Xml.Serialization
68.System.Xml.XPath
69.System.Xml.Xsl
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp by API » System.Drawing » Graphics 
Graphics.TextRenderingHint
  

/*
User Interfaces in C#: Windows Forms and Custom Controls
by Matthew MacDonald

Publisher: Apress
ISBN: 1590590457
*/
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing.Text;

namespace GDI_Basics
{
    /// <summary>
    /// Summary description for SmoothingFonts.
    /// </summary>
    public class SmoothingFonts : System.Windows.Forms.Form
    {
        internal System.Windows.Forms.Label Label3;
        internal System.Windows.Forms.Label Label2;
        internal System.Windows.Forms.Label Label1;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public SmoothingFonts()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Disposebool disposing )
        {
            ifdisposing )
            {
                if(components != null)
                {
                    components.Dispose();
                }
            }
            base.Disposedisposing );
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.Label3 = new System.Windows.Forms.Label();
            this.Label2 = new System.Windows.Forms.Label();
            this.Label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // Label3
            // 
            this.Label3.BackColor = System.Drawing.Color.White;
            this.Label3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.Label3.Location = new System.Drawing.Point(272168);
            this.Label3.Name = "Label3";
            this.Label3.Size = new System.Drawing.Size(12816);
            this.Label3.TabIndex = 5;
            this.Label3.Text = " ClearTypeGridFit";
            // 
            // Label2
            // 
            this.Label2.BackColor = System.Drawing.Color.White;
            this.Label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.Label2.Location = new System.Drawing.Point(272100);
            this.Label2.Name = "Label2";
            this.Label2.Size = new System.Drawing.Size(12816);
            this.Label2.TabIndex = 4;
            this.Label2.Text = " AntiAliasGridFit";
            // 
            // Label1
            // 
            this.Label1.BackColor = System.Drawing.Color.White;
            this.Label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.Label1.Location = new System.Drawing.Point(27236);
            this.Label1.Name = "Label1";
            this.Label1.Size = new System.Drawing.Size(12816);
            this.Label1.TabIndex = 3;
            this.Label1.Text = " SingleBitPerPixelGridFit";
            // 
            // SmoothingFonts
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(514);
            this.ClientSize = new System.Drawing.Size(440314);
            this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                          this.Label3,
                                                                          this.Label2,
                                                                          this.Label1});
            this.Font = new System.Drawing.Font("Tahoma"8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.Name = "SmoothingFonts";
            this.Text = "SmoothingFonts";
            this.Paint += new System.Windows.Forms.PaintEventHandler(this.SmoothingFonts_Paint);
            this.ResumeLayout(false);

        }
        #endregion


        [STAThread]
        static void Main() 
        {
            Application.Run(new SmoothingFonts());
        }

        private void SmoothingFonts_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
        {
            Font TextFont = new Font("Times New Roman"25, FontStyle.Italic);
            e.Graphics.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
            e.Graphics.DrawString("Sample Text", TextFont, Brushes.Black, 2020);
            e.Graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
            e.Graphics.DrawString("Sample Text", TextFont, Brushes.Black, 2085);
            e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            e.Graphics.DrawString("Sample Text", TextFont, Brushes.Black, 20150);
        }
    }
}

   
    
  
Related examples in the same category
1.Graphics.Clear
2.Graphics.CopyFromScreen
3.Graphics.DashCap
4.Graphics.Dispose()
5.Graphics.DpiX
6.Graphics.DpiY
7.Graphics.DrawArc
8.Graphics.DrawBeziers
9.Graphics.DrawEllipse
10.Graphics.DrawIcon(Icon icon, int x, int y)
11.Graphics.DrawImage(Image i, int x, int y);
12.Graphics.DrawImage(Image img, int x, int y, int width, int height)
13.Graphics.DrawImage(im, rec, recPart, GraphicsUnit.Pixel)
14.Graphics.DrawImage(Image, Points[])
15.Graphics.DrawLine(Pen p, int x0,int y0, int x1, int y1)
16.Graphics.DrawLine(Pen,Point point1, Point point2)
17.Graphics.DrawLines(Pen pen, Point[] points)
18.Graphics.DrawPie
19.Graphics.DrawRectangle
20.Graphics.DrawRectangles
21.Graphics.DrawString
22.Graphics.EnumerateMetafileProc
23.Graphics.FillClosedCurve
24.Graphics.FillEllipse
25.Graphics.FillEllipse(Brush brush,int x, int y,int width,int height)
26.Graphics.FillPath(Brushes.AliceBlue, myPath);
27.Graphics.FillPolygon
28.Graphics.FillRectangle
29.Graphics.FillRectangles
30.Graphics.FillRegion
31.Graphics.FromHwnd()
32.Graphics.FromImage
33.Graphics.InterpolationMode
34.Graphics.MeasureString
35.Graphics.PageScale
36.Graphics.PageUnit
37.Graphics.PixelOffsetMode
38.Graphics.ReleaseHdc
39.Graphics.RotateTransform
40.Graphics.ScaleTransform
41.Graphics.SetClip
42.Graphics.SetClip(path, (CombineMode)miCombineMode.Index)
43.Graphics.SmoothingMode
44.Graphics.Transform
45.Graphics.TranslateClip
46.Graphics.TranslateTransform
47.Graphics.VisibleClipBounds
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.