public static GDIContext CreateForMemory() { IntPtr hdc; hdc = GDI32.CreateCompatibleDC(GDIContext.CreateForDefaultDisplay()); GDIContext newConText = new GDIContext(hdc, true); return newConText; }