TextRenderingHint Sabit listesi

Tanım

Metin işlemenin kalitesini belirtir.

public enum class TextRenderingHint
public enum TextRenderingHint
type TextRenderingHint = 
Public Enum TextRenderingHint
Devralma
TextRenderingHint

Alanlar

Name Değer Description
SystemDefault 0

Her karakter, sistem varsayılan işleme ipucuyla birlikte glif bit eşlemi kullanılarak çizilir. Metin, kullanıcının sistem için seçtiği yazı tipi düzeltme ayarları kullanılarak çizilir.

SingleBitPerPixelGridFit 1

Her karakter kendi glif bit eşlemi kullanılarak çizilir. İpucu, saplar ve eğrilik üzerindeki karakter görünümünü geliştirmek için kullanılır.

SingleBitPerPixel 2

Her karakter kendi glif bit eşlemi kullanılarak çizilir. İpucu oluşturma kullanılmaz.

AntiAliasGridFit 3

Her karakter, ipucu içeren antialiased glif bit eşlemi kullanılarak çizilir. Antialiasing nedeniyle çok daha iyi kalite, ancak daha yüksek performans maliyeti.

AntiAlias 4

Her karakter, ipucu olmadan antialiased glif bit eşlemi kullanılarak çizilir. Antialiasing nedeniyle daha iyi kalite. İpucu kapalı olduğundan kök genişliği farklılıkları fark edilebilir.

ClearTypeGridFit 5

Her karakter, ipucu içeren glif ClearType bit eşlemi kullanılarak çizilir. En yüksek kalite ayarı. ClearType yazı tipi özelliklerinden yararlanmak için kullanılır.

Örnekler

Aşağıdaki kod örneği, ve TextRenderingHint özelliklerinin ve numaralandırmasının TextContrastTextRenderingHint kullanımını gösterir.

Bu örnek, Windows Forms ile kullanılacak şekilde tasarlanmıştır. Kodu bir forma yapıştırın ve formun ChangeTextRenderingHintAndTextContrastPaint olayını işlerken yöntemini olarak geçirerek ePaintEventArgsçağırın.

private:
   void ChangeTextRenderingHintAndTextContrast( PaintEventArgs^ e )
   {
      // Retrieve the graphics object.
      Graphics^ formGraphics = e->Graphics;

      // Declare a new font.
      System::Drawing::Font^ myFont = gcnew System::Drawing::Font( FontFamily::GenericSansSerif,20,FontStyle::Regular );

      // Set the TextRenderingHint property.
      formGraphics->TextRenderingHint = System::Drawing::Text::TextRenderingHint::SingleBitPerPixel;

      // Draw the string.
      formGraphics->DrawString( "Hello World", myFont, Brushes::Firebrick, 20.0F, 20.0F );

      // Change the TextRenderingHint property.
      formGraphics->TextRenderingHint = System::Drawing::Text::TextRenderingHint::AntiAliasGridFit;

      // Draw the string again.
      formGraphics->DrawString( "Hello World", myFont, Brushes::Firebrick, 20.0F, 60.0F );

      // Set the text contrast to a high-contrast setting.
      formGraphics->TextContrast = 0;

      // Draw the string.
      formGraphics->DrawString( "Hello World", myFont, Brushes::DodgerBlue, 20.0F, 100.0F );

      // Set the text contrast to a low-contrast setting.
      formGraphics->TextContrast = 12;

      // Draw the string again.
      formGraphics->DrawString( "Hello World", myFont, Brushes::DodgerBlue, 20.0F, 140.0F );

      // Dispose of the font object.
      delete myFont;
   }
private void ChangeTextRenderingHintAndTextContrast(PaintEventArgs e)
{

    // Retrieve the graphics object.
    Graphics formGraphics = e.Graphics;

    // Declare a new font.
    Font myFont = new Font(FontFamily.GenericSansSerif, 20, 
        FontStyle.Regular);

    // Set the TextRenderingHint property.
    formGraphics.TextRenderingHint = 
        System.Drawing.Text.TextRenderingHint.SingleBitPerPixel;

    // Draw the string.
    formGraphics.DrawString("Hello World", myFont, 
        Brushes.Firebrick, 20.0F, 20.0F);

    // Change the TextRenderingHint property.
    formGraphics.TextRenderingHint = 
        System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;

    // Draw the string again.
    formGraphics.DrawString("Hello World", myFont, 
        Brushes.Firebrick, 20.0F, 60.0F);

    // Set the text contrast to a high-contrast setting.
    formGraphics.TextContrast = 0;

    // Draw the string.
    formGraphics.DrawString("Hello World", myFont, 
        Brushes.DodgerBlue, 20.0F, 100.0F);

    // Set the text contrast to a low-contrast setting.
    formGraphics.TextContrast = 12;

    // Draw the string again.
    formGraphics.DrawString("Hello World", myFont, 
        Brushes.DodgerBlue, 20.0F, 140.0F);

    // Dispose of the font object.
    myFont.Dispose();
}
Private Sub ChangeTextRenderingHintAndTextContrast(ByVal e As _
    PaintEventArgs)

    ' Retrieve the graphics object.
    Dim formGraphics As Graphics = e.Graphics

    ' Declare a new font.
    Dim myFont As Font = New Font(FontFamily.GenericSansSerif, _
        20, FontStyle.Regular)

    ' Set the TextRenderingHint property.
    formGraphics.TextRenderingHint = _
        System.Drawing.Text.TextRenderingHint.SingleBitPerPixel

    ' Draw the string.
    formGraphics.DrawString("Hello World", myFont, _
        Brushes.Firebrick, 20.0F, 20.0F)

    ' Change the TextRenderingHint property.
    formGraphics.TextRenderingHint = _
        System.Drawing.Text.TextRenderingHint.AntiAliasGridFit

    ' Draw the string again.
    formGraphics.DrawString("Hello World", myFont, _
        Brushes.Firebrick, 20.0F, 60.0F)

    ' Set the text contrast to a high-contrast setting.
    formGraphics.TextContrast = 0

    ' Draw the string.
    formGraphics.DrawString("Hello World", myFont, _
        Brushes.DodgerBlue, 20.0F, 100.0F)

    ' Set the text contrast to a low-contrast setting.
    formGraphics.TextContrast = 12

    ' Draw the string again.
    formGraphics.DrawString("Hello World", myFont, _
        Brushes.DodgerBlue, 20.0F, 140.0F)

    ' Dispose of the font object.
    myFont.Dispose()

End Sub

Açıklamalar

Kalite, metinden (en hızlı performans, ancak en düşük kalite) antialiased metne (daha iyi kalite, ancak daha yavaş performans) ClearType metnine (LCD ekranda en iyi kalite) kadar değişir.

Şunlara uygulanır