class_docstr: Helper to grab a series of screenshots from the current Canvas-like object.
code: def _grab_vispy_screenshots(self):
      os.environ["VISPY_IGNORE_OLD_VERSION"] = "true"
      self._canvas.events.draw.connect(self.on_draw, position="last")
      with self._canvas as c:
          self._collect_frames(c)
  
imports: from __future__ import annotations
  import os
  import time
  import shutil
  from vispy.io import imsave
  from vispy.gloo.util import _screenshot
  from vispy.scene import SceneCanvas
  from sphinx_gallery.scrapers import optipng, figure_rst
label_desc: Use image node_id 9 for calling the FrameGrabber obj's underlying member method code with example usage: obj._grab_vispy_screenshots() without return types