I search a way to save the graphics in a "EMF" file.
I got the following code. It really work. I can get a vector graphics file. but i cannot understand how the function work. can someone help me?
Bitmap bmp = new Bitmap(Width, Height);
Graphics gs = Graphics.FromImage(bmp);
Metafile mf = new Metafile(filePath, gs.GetHdc(), ClientRectangle, MetafileFrameUnit.Pixel);
Graphics g = Graphics.FromImage(mf);
g.DrawRectangle(Pens.Black, new Rectangle(new Point(10, 10), new Size(30, 30)));
g.Save();
g.Dispose();
mf.Dispose();
gs.Dispose();
bmp.Dispose();