How to save bitmap data from the current view?


I have been writing script to capture screen for current view in ghPython.
Trying to find approach in web site, Rhino.Display.DisplayPipeline.DrawToBitmap() could be one option. But I cannot find how to get current view.
Can anyone tell me how to do this?

Thank you.

import rhinoscriptsyntax as  rs
result = rs.CreatePreviewImage("test.jpg")
if result:
print  "test.jpg created successfully."
print  "Unable to create preview image."

1 Like

I have recently written something to take squared screenshots. Though for GH maybe interesting: Pastebin

1 Like