CaptureToBitmap with multiple displaySetting

got some trouble to capture a view with different display settings…Basically I loop through all existing display settings and use CaptureToBitmap.

But for some reason the CaptureToBitmap doesn’t capture all display settings
It seems the change of display setting is to fast for the CaptureToBitmap…
Any help?


string mydir = @"C:\";

Rhino.Display.RhinoView view = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView;
for (int i = 0; i < Rhino.Display.DisplayModeDescription.GetDisplayModes().Count(); i++)
  view.ActiveViewport.DisplayMode = Rhino.Display.DisplayModeDescription.GetDisplayModes()[i];

  var bitmap = doc.Views.ActiveView.CaptureToBitmap(new Size(400, 400), false, false, false);
  var file_name = System.IO.Path.Combine(mydir, Convert.ToString(i + ".jpg"));


Maybe use a RhinoApp.Wait() in between the re-draw and the capture?

Or wait for the RhinoApp.Idle event to be triggered after the redraw.

Thanks! RhinoApp.Idle seems the one I was looking for.