public static Bitmap GetMetafileFromClipboard()
 {
     OpenClipboard(IntPtr.Zero);
     IntPtr hemf = GetClipboardData(CF_ENHMETAFILE);
     CloseClipboard();
     if (hemf != IntPtr.Zero)
     {
         Metafile mf = new Metafile(hemf, true);
         Bitmap b = new Bitmap(mf.Width, mf.Height);
         Graphics g = Graphics.FromImage(b);
         GraphicsUnit unit = GraphicsUnit.Millimeter;
         RectangleF rsrc = mf.GetBounds(ref unit);
         g.PageUnit = GraphicsUnit.Pixel;
         g.DrawImage(mf, 0, 0, mf.Width, mf.Height);
         g.Dispose();
         GC.SuppressFinalize(g);
         return b;
     }
     return null;
 }