Hi ,
Attempting to create a plugin component that outputs some screenshots of the viewport.
Its got some inputs like changing background colour, image resolution etc.
I am changing the viewport background colour programmatically like so -
if (backgroundColour != null && !transparentBackground)
{
//redraw background with input colour for screencapture
Rhino.ApplicationSettings.AppearanceSettings.ViewportBackgroundColor = backgroundColour;
RhinoDocument.Views.Redraw();
}
I noticed this only works if I set the viewport display setting for background as Use Application Settings"
Is there anyway we can set this programmatically as well?
I want to make sure the code sets this to application setting before changing background colour and redrawing the viewport. It then reverts back at the end to whatever setting it was before.
If anyone could point me to the right page in the documentation or provide any insights that would be great!
using System;
using Rhino;
using Rhino.Display;
var doc = RhinoDoc.ActiveDoc;
var displayMode = doc.Views.Find("Perspective", false).ActiveViewport.DisplayMode;
displayMode.DisplayAttributes.FillMode = DisplayPipelineAttributes.FrameBufferFillMode.Gradient2Color;
DisplayModeDescription.UpdateDisplayMode(displayMode);