Re: Antialiasing rendering of metafile images

Tech-Archive recommends: Speed Up your PC by fixing your registry



Antialiasing is a cheat. Pixel boundaries are calculated on a sub-pixel level and the pixels near to that boundary are set according to the weight of the colours tat coincide with the larger pixel.

A metafile is a set of drawing instructions that are effectively tokenised commands. If the tokens cannot express the antialiasing command or the metafile playback renderer cannot understand them then the graphics will be rendered at the best quality the tokens can express.

Metafiles have no antialiasing commands because this function is a state setting of the graphics renderer, not a drawing command that can be tokenised and stored.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





Liviu Balan wrote:
Since .Net 2.0 has more support for vector graphics (Metafiles) this can be put to use on a so called "resolution free" GUI. However a big problem appeared here. The rendered metafile object does not use antialiasing and as a result it looks pretty rough on the screen.

As a simple test one might want to draw a circle and draw beside a metafile that contains the same circle, both at the same size. They are both painted on the same DC with SmoothingMode property set to AntiAlias. As you have already guessed the DrawCircle method will provide a smooth result, while the metafile will have a very rough appearence. Probably the redering of the metafile ignores the antialiasing property of the device context it is painted on.


Any thoughts or advice on how to overcome this problem?

Thank you,
Liviu Balan

Systems Engineering






.



Relevant Pages

  • Re: Antialiasing rendering of metafile images
    ... this is a problem with the metafile renderer and not with the ... primitive Draw command would be drawn to the screen. ... Metafiles have no antialiasing commands because this function is a state ...
    (microsoft.public.dotnet.framework.drawing)
  • Antialiasing rendering of metafile images
    ... The rendered metafile object does not use antialiasing and as ... As a simple test one might want to draw a circle and draw beside a metafile ... on the same DC with SmoothingMode property set to AntiAlias. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: The Guardians website Sudoku
    ... Yeah, if a line is too thin to cover the width of an entire pixel, ... antialiasing wouldn't be needed if they just made their lines a little ... I suppose this being the Guardian though, ...
    (alt.html)
  • Re: =?ISO-8859-15?Q?Schn=E4ppchen_oder_Perlen_vor_die_?= =?ISO-8859-15?Q?S=E4ue=3F?=
    ... hab die 8800 gts 320 mb ram, läuft super, trackmania sogar auf voller auflösung mit höchster grafikeinstellung. ... vergiss das antialiasing, da is nr für kleine auflösungen was wert, bei ... auch auf meinem laptop benutz ich 1650 x 1050 Pixel ... in 3 monaten ist wieder was anderes "moderat". ...
    (de.comp.hardware.graphik)
  • Re: Rendering text question (context is MSWin UI Automation)
    ... from the wx generated model matches the green layer from the app's window, pixel ... for pixel (at least with antialiasing and cleartype on, ...
    (comp.lang.python)