code: def grab(self, monitor):
          # type: (Monitor) -> ScreenShot
          
  
          # Convert PIL bbox style
          if isinstance(monitor, tuple):
              monitor = {
                  "left": monitor[0],
                  "top": monitor[1],
                  "width": monitor[2] - monitor[0],
                  "height": monitor[3] - monitor[1],
              }
  
          ximage = self.xlib.XGetImage(
              MSS.display,
              self.drawable,
              monitor["left"],
              monitor["top"],
              monitor["width"],
              monitor["height"],
              PLAINMASK,
              ZPIXMAP,
          )
  
          try:
              bits_per_pixel = ximage.contents.bits_per_pixel
              if bits_per_pixel != 32:
                  raise ScreenShotError(
                      "[XImage] bits per pixel value not (yet?) implemented: {}.".format(
                          bits_per_pixel
                      )
                  )
  
              raw_data = ctypes.cast(
                  ximage.contents.data,
                  ctypes.POINTER(
                      ctypes.c_ubyte * monitor["height"] * monitor["width"] * 4
                  ),
              )
              data = bytearray(raw_data.contents)
          finally:
              # Free
              self.xlib.XDestroyImage(ximage)
  
          return self.cls_image(data, monitor)
docs: Retrieve all pixels from a monitor. Pixels have to be RGB.