I want to add some text to a metafile.
The code i use:
Metafile m = new Metafile("1.emf");
Graphics grfxVideo = CreateGraphics();
IntPtr ipHdc = grfxVideo.GetHdc();
Metafile mf = new Metafile("2.emf", ipHdc);
grfxVideo.ReleaseHdc(ipHdc);
grfxVideo.Dispose();
Graphics grfxMetafile = Graphics.FromImage(mf);
grfxMetafile.DrawImage(m, 0, 0);
grfxMetafile.DrawString("test",SystemFonts.DefaultFont,SystemBrushes.Desktop,new PointF(0,0));
grfxMetafile.Dispose();
mf.Dispose();
m.Dispose();
The letters at the new metafile (2.emf) is more bold than the original emf file. Also the new metafile is at least twice the size of the original. What am i doing wrong?
Edit: the original emf file (1.emf) is created from an emf spool file and the text is inside the ExtTextOutW
and ExtTextOutA
records.