![]() |
|
|
|
|
1
13th April 00:24
External User
Posts: 1
|
You can create and save metafiles directly by creating a windows metafile
and then draw on it using a Graphics object. Graphics g = this.CreateGraphics(); //not often you'll see me do this... IntPtr hdc = g.GetHdc(); Metafile mf = new Metafile("poop.emf",hdc); Graphics mfg = Graphics.FromImage(mf); mfg.DrawRectangle(Pens.Red, new Rectangle(10, 10, 100, 20)); g.ReleaseHdc(hdc); g.Dispose(); mfg.Dispose(); mf.Dispose(); -- -- Bob Powell [MVP] Visual C#, System.Drawing Ramuseco Limited .NET consulting http://www.ramuseco.com Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET. Subscribe to the RSS feeds provided and never miss a new article. |
|
|
|