Groups | Blog | Home
all groups > dotnet drawing api > february 2008 >

dotnet drawing api : reasterization of wmf/emf data looks terrible on vista


Andy Fish
2/21/2008 2:30:22 PM
Hello,

I am using graphics.DrawImage() in the .Net 2.0 CLR to convert a wmf/emf
vector image to png. the data is actually a preview of a spreadsheet
embedded in a word document.

If I do this on vista, text output looks really blocky (as if it were
triple-bold or something) compared to how it looks on XP or 2003 server
(which is pretty much the same as it looks on the screen in word)

anyone got any ideas what could be affecting this or is it just (shock,
horror) a bug in vista ?

Andy
Andy Fish
2/22/2008 4:14:02 PM
just as a follow-up on this one

I discover that the problem is not OS dependent - it's to do with with
antialiasing of screen fonts (i.e. "smooth edges of screen fonts" in the
display control panel). if this setting is off, the results are reasonable,
but with this setting on the text is all blocky.

i would guess it's trying to antialias but for some reason all the extra
pixels it inserts are coming out black

FWIW here's my code. any reason this would not antialias text properly?

Image inputMetafile = new Metafile(inputStream);
Image outputBitmap = new Bitmap(width, height),
PixelFormat.Format24bppRgb);
Graphics graphics = Graphics.FromImage(outputBitmap);
graphics.Clear(Color.White);
graphics.DrawImage(inputMetafile, new Rectangle(new Point(0, 0), new
Size(width, height)));
outputBitmap.Save(outputStream, ImageFormat.Jpeg);

Andy

[quoted text, click to view]

DogOne
3/20/2008 6:31:00 AM
Andy,

I am having the same problem. Were you able to fix this?

Thanks,
AddThis Social Bookmark Button