Capturing Viewports on Rhino 7 & 8

Hello, I’ve been developing a set of custom components, and I need to save viewports as images.

I tried doing this with RhinoDoc.ActiveDoc.Views.CaptureToBitmap(), and this works perfectly well enough for Rhino 8.
I have to target Rhino 7 as well however, and I found that the namespace Grasshopper.Rhinoceros.Display does not exist for it. I need this in order to access the type ModelStandardViewport, which is the input to one of my components.

Is there a way to capture viewports on Grasshopper / Rhino 7 programmatically? Or am I going about this the wrong way (in terms of not using built-in components)?

Thank you in advance for any help or insight!

EDIT: I couldn’t find any developer docs for Rhino 7 / Grasshopper. If anyone could point me to it, I would check that as well.

Krishna Sivakumar