My code enumerates a metafile:
private void Parse()
{
Graphics graphics = Graphics.FromHwnd(IntPtr.Zero);
PointF pointf = new PointF();
graphics.EnumerateMetafile(_metafile, pointf, ParseCallback);
}
private bool ParseCallback(EmfPlusRecordType recordType,
int flags, int dataSize, IntPtr data, PlayRecordCallback callbackData)
{
// do stuff
}
My development machine is Windows 7 VirtualBox
guest on Ubuntu host.
The code used to work fine. However, when I turned off Aero, the code stopped working: The ParseCallback
would never be called.
Only when I turned Aero back on, ParseCallback
was executed again.
Why and how can I make this code work on non-Aero-enabled machines?