code: def __init__(self, size=(600, 600)):
      # We hide the canvas upon creation.
      app.Canvas.__init__(self, show=False, size=size)
      self._t0 = time()
      # Texture where we render the scene.
      self._rendertex = gloo.Texture2D(shape=self.size[::-1] + (4,))
      # FBO.
      self._fbo = gloo.FrameBuffer(
          self._rendertex, gloo.RenderBuffer(self.size[::-1])
      )
      # Regular program that will be rendered to the FBO.
      self.program = gloo.Program(vertex, fragment)
      self.program["position"] = [
          (-1, -1),
          (-1, 1),
          (1, 1),
          (-1, -1),
          (1, 1),
          (1, -1),
      ]
      self.program["scale"] = 3
      self.program["center"] = [-0.5, 0]
      self.program["iter"] = 300
      self.program["resolution"] = self.size
      # We manually draw the hidden canvas.
      self.update()
  
file_path: vispy/examples/demo/gloo/offscreen.py
imports: from vispy import gloo
  from vispy import app
  from vispy.util.ptime import time
  from vispy.gloo.util import _screenshot
label_desc: Use image node_id 1 to create a new Canvas object from inherited base classes: app with example: obj = Canvas(size)