Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3423084
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:18:50+00:00 2026-05-18T06:18:50+00:00

Using GDI+ to draw text on glass: graphics.DrawString(s, Length(s), font, MakePointF(x, y), brush); You’ll

  • 0

Using GDI+ to draw text on glass:

graphics.DrawString(s, Length(s), font, MakePointF(x, y), brush);

You’ll notice that the ClearType enabled text draws very poorly on glass:

alt text

But with glass disabled the text, of course, draw fine:

alt text

By way of comparison here is Anti-alias font smoothing:

alt text

And here is no font smoothing:

alt text

Note: No font smoothing looks better than it really does because StackOverflow resizes the images on your monitor.

How do i draw ClearType text on glass?

Notes

  • Win32 native
  • not .NET (i.e. native)
  • not Winforms (i.e. native)
  • GDI+ (i.e. native)

What Mark is suggesting is that you cannot honor the user’s preferences for text rendering (i.e. “SystemDefault“. ClearType does not function on glass, and you cannot use it.

In other words, if you’re rendering on glass you must override the text rendering with:

graphics.SetTextRenderingHint(TextRenderingHintAntiAliasGridFit);

Otherwise you should leave the TextRenderingHint at it’s default TextRenderingHintSystemDefault.

See also

  • Aero: How to draw solid colors on glass?
  • Windows Aero: What color to paint to make “glass” appear?
  • WPF: Extending glass into client area disables ClearType entirely
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:18:50+00:00Added an answer on May 18, 2026 at 6:18 am

    The problem is inherent to the way drawing is performed. All of your text is being drawn on a black background, then composited onto a glass background; the semi-transparent font smoothing is being combined with black to make near-black.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a library that draw on to given HDC using GDI+ apis. I
I'm drawing some graphics and text with GDI in my CScrollView. I need to
I am using gdi c++, StretchDIBits function sometimes failed if I draw large Images
I'm using the RoundRect GDI function to draw a rounded rectangle following this example:
I have winform with a TextBox and I want to draw some GDI graphics
I'm using directx to draw my string, directx uses GDI to draw the string..
I noticed using task manager that the following code has a GDI leak in
I am trying to write some vertical text using MFC GDI and somehow the
I am using a GDI+ Graphic to draw a 4000*3000 image to screen, but
I'm attempting to display some text in my program using (say) Windows GDI and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.