title: How to enable anti-aliasing when rendering WMF to BitMap in C#/WPF/WinForms?
body: <p>Why won't lines etc be anti-aliased when doing this?</p>
  
  <pre><code>using (var myGraphics = Graphics.FromImage(bitmap))
  {
  myGraphics.CompositingQuality = CompositingQuality.HighQuality;
  myGraphics.SmoothingMode = SmoothingMode.HighQuality;
  myGraphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
  
  myGraphics.Clear(backgroundColor);
  
  myGraphics.EnumerateMetafile(m_metafile, new Point(0, 0), m_metafileDelegate);
  }
  </code></pre>
  
  <p>The delegate function looks like this:</p>
  
  <pre><code>private bool MetafileCallback(EmfPlusRecordType recordType, int flags, int dataSize, IntPtr data, PlayRecordCallback callbackData)
  {
          byte[] dataArray = null;
          if (data != IntPtr.Zero)
          {
              // Copy the unmanaged record to a managed byte buffer 
              // that can be used by PlayRecord.
              dataArray = new byte[dataSize];
              Marshal.Copy(data, dataArray, 0, dataSize);
          }
  
          m_metafile.PlayRecord(recordType, flags, dataSize, dataArray);
  
          return true;
  }
  </code></pre>
  
  <p>Do I need to override PlayRecord for a specific type to get anti-aliasing here?</p>
  
  <p>The WMFs come from AutoCAD, if that's any help.</p>