How to export a quick image with viewport frame from opened document using C#

Hey guys,

I have a C# program that needs to be able to automatically to an “Export a quick image” with “viewport frame” from the currently opened document.

Do you have some API commands that allow me to do that?

IF not, do you have some suggestions?
Should I use some of those libraries that allow me to automatically press the buttons within the tools?

_WinWaitActivate(“Grasshopper - Test”,"")
_WinWaitActivate(“Quick Image Editor”,"")
_WinWaitActivate(“Grasshopper Canvas Image”,"")

find attached C# (5.1 KB)