我使用以下代码获取了numpy数组:
channels_count = 4pixmap = self._screen.grabWindow(0, self._x, self._y, self._width, self._height)image = pixmap.toImage()s = image.bits().asstring(self._width * self._height * channels_count)arr = np.fromstring(s, dtype=np.uint8).reshape((self._height, self._width, channels_count))



