class_docstr: Helper to grab a series of screenshots from the current Canvas-like object.
docstr: Show current Canvas and render and collect all frames requested.
docstr_tok: ["Show","current","Canvas","and","render","and","collect","all","frames","requested","."]
code: def collect_frames(self):
      """Show current Canvas and render and collect all frames requested."""
      if self._is_qt_widget():
          self._grab_qt_screenshot()
      else:
          self._grab_vispy_screenshots()
  
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 4 for calling the FrameGrabber obj's underlying member method code with example usage: obj.collect_frames() without return types