Hi,
I belive there is a bug in display pipeline.DrawToBitmap
and RhinoView.CaptureToBitmap
functions (probably both calls to the same source function)
Setting a 1000x1000 resolution the result is ok (Color is good):
but setting a wide ratio (2000x1000) the result looks white
This is the exemple code:
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
var circle = new Circle(Plane.WorldXY, 10).ToNurbsCurve();
var hatches = Hatch.Create(circle, 0, 0, 1, RhinoDoc.ActiveDoc.ModelAbsoluteTolerance);
var attr = RhinoDoc.ActiveDoc.CreateDefaultAttributes();
attr.ColorSource = ObjectColorSource.ColorFromObject;
attr.ObjectColor = Color.Crimson;
foreach (var hatch in hatches)
RhinoDoc.ActiveDoc.Objects.AddHatch(hatch, attr.Duplicate());
var pathDesktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
var bm1 = DisplayPipeline.DrawToBitmap(RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport, 2000, 1000);
bm1.Save(Path.Combine(pathDesktop, "2000x1000LooksGray.jpg"));
var bm2 = RhinoDoc.ActiveDoc.Views.ActiveView.CaptureToBitmap(new Size(1000, 1000));
bm2.Save(Path.Combine(pathDesktop, "1000x1000LooksOK.jpg"));
return Result.Success;
}
Could you let me know if there is an other way to capture the bitmap in wide snapshot?
Thanks and Best Regards