Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

How does the function "Graphics.Save()" work in save as mef?

$
0
0

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();


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>