Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Textrenderinghint=antialiasing does not work with metafile

Posted on 2009-05-14
6
Medium Priority
?
792 Views
Last Modified: 2012-06-21
I created a metafile containing a chart in vb.net. I set the TextRenderingHint to AntiAlias. When I display the metafile, the text quality is very poor. If I use the FillRectange to fill the bounds of the chart to White, the text looks great. Unfortunately, I cannot always fill the background with white. Is there an alternative way to display the metafile so the text looks good?
0
Comment
Question by:JerryHintze
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 39

Expert Comment

by:abel
ID: 24390514
Did you use ImageFormat.Wmf? Because that's the old (from windows 3.0, 16 bit) format. The format you are probably after is ImageFormat.Emf, which works perhaps better.
0
 
LVL 39

Expert Comment

by:abel
ID: 24391001
Not sure whether this is applicable or not, but from tthe EMF specs I get that it still depends (on whether the font supposrts it or not). This is what MS specs says if you use AntiAliased or ClearType:

ANTIALIASED_QUALITY: Specifies that anti-aliasing SHOULD be used when rendering text, if the font supports it.<10>
CLEARTYPE_QUALITY: Specifies that ClearType anti-aliasing SHOULD be used when rendering text, if the font supports it. <11>Fonts that do not support ClearType anti-aliasing include type 1 fonts, PostScript fonts, OpenType fonts without TrueType outlines, rasterized fonts, vector fonts, and device fonts.
source: http://msdn.microsoft.com/en-us/library/cc215212.aspx.
0
 

Author Comment

by:JerryHintze
ID: 24391119
I'm using the emf format, not the wmf. I'm using Arial, Times Roman, Tahoma fonts which shouldn't have a problem. The crazy thing is, if I fill the background with a white rectangle, it works. If I don't, it doesn't. I guess I just have to have a background for anti-aliasing to work.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 39

Expert Comment

by:abel
ID: 24391219
You are apparently not alone. It seems that some programs don't write the antialiased records, but even if, then there are many programs that do not read that record. You may try EMFExplorer to actually find out whether the records are available and how it looks using GDI or GDI+: http://frazmitic.free.fr/emfexplorer/

You may also check out this thread, which seems to express the same problem, but unfortunately without a solution: http://www.eggheadcafe.com/conversation.aspx?messageid=29400144&threadid=29400136
0
 

Author Comment

by:JerryHintze
ID: 24397107
I found that my problem occurred from using TextRendingHint = ClearTypeGridFit. When I set this option to AntiAlias, the text is displayed fine.
0
 
LVL 39

Accepted Solution

by:
abel earned 2000 total points
ID: 24397363
Ah, good. Interesting, because in your original question you said "Textrenderinghint=antialiasing" and I assumed normal antialiasing. ClearType must be supported by the font, and you use a TrueType font. Hence the situation.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question