FileStream fs = new FileStream("1.emf", FileMode.Open); Metafile m= new Metafile(fs); fs.Close(); Graphics grfxVideo = CreateGraphics(); IntPtr ipHdc = grfxVideo.GetHdc(); Metafile mf = new Metafile("2.emf", ipHdc); grfxVideo.ReleaseHdc(ipHdc); Font newFont = new Font("Arial", 16, FontStyle.Bold); Graphics grfxMetafile = Graphics.FromImage(mf); grfxMetafile.DrawImage(m, 0, 0); //now 2.emf is the same with 1.emf int y = m.Height; float y1 = m.VerticalResolution; // SizeF size = m.PhysicalDimension; float testx = grfxMetafile.DpiX / 25.4f; grfxMetafile.DrawString("test message", SystemFonts.DefaultFont, SystemBrushes.Desktop, new PointF(0,y-100); //pictureBox1.Image = mf; grfxVideo.Dispose(); mf.Dispose(); grfxMetafile.Dispose(); m.Dispose();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)