Dale,
The example works.
However, I want to control the dpi and boundary of the image and use the static method Rhino.Display.ViewCapture.CaptureToBitmap(ViewCaptureSetting).This method is now always capturing the image in wireframe mode. Is there a way to specify dpi using Rhino.Display.ViewCapture.CaptureToBitmap(RhinoView) method? Thanks.
Directory.CreateDirectory(targetFolder);
Rhino.Display.RhinoView currView = RhinoDoc.ActiveDoc.Views.ActiveView;
Rhino.Display.RhinoViewport currViewPort = currView.ActiveViewport;
Rhino.Geometry.BoundingBox bb = geo.GetBoundingBox(false);
currViewPort.ZoomBoundingBox(bb);
double width = (bb.Max - bb.Min).X + 10;
double height = (bb.Max - bb.Min).Y + 10;
double dpi = 100;
Rhino.Display.ViewCaptureSettings setting = new Rhino.Display.ViewCaptureSettings(currView, new Size((int) (width * dpi), (int) (height * dpi)), dpi);
System.Drawing.Bitmap bitmap = Rhino.Display.ViewCapture.CaptureToBitmap(setting);
bitmap.Save(targetFolder + name + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);