class_docstr: **Bases:** :class:`GraphicsObject <pyqtgraph.GraphicsObject>`
class_docstr_tok: ["*","*","Bases",":","*","*",":","class",":","`","GraphicsObject","<","pyqtgraph.GraphicsObject",">","`"]
code: def _drawPicture(self) -> QtGui.QPicture:
      # on entry, the following members are all valid: x, y, z, levels
      # this function does not alter any state (besides using self.quads)
  
      picture = QtGui.QPicture()
      painter = QtGui.QPainter(picture)
      # We set the pen of all polygons once
      if self.edgecolors is None:
          painter.setPen(QtCore.Qt.PenStyle.NoPen)
      else:
          painter.setPen(self.edgecolors)
          if self.antialiasing:
              painter.setRenderHint(
                  QtGui.QPainter.RenderHint.Antialiasing
              )
  
      ## Prepare colormap
      # First we get the LookupTable
      lut = self.lut_qcolor
      # Second we associate each z value, that we normalize, to the lut
      scale = len(lut) - 1
      lo, hi = self.levels[0], self.levels[1]
      rng = hi - lo
      if rng == 0:
          rng = 1
      norm = fn.rescaleData(
          self.z, scale / rng, lo, dtype=int, clip=(0, len(lut) - 1)
      )
  
      if Qt.QT_LIB.startswith("PyQt"):
          drawConvexPolygon = lambda x: painter.drawConvexPolygon(*x)
      else:
          drawConvexPolygon = painter.drawConvexPolygon
  
      self.quads.resize(self.z.shape[0], self.z.shape[1])
      memory = self.quads.ndarray()
      memory[..., 0] = self.x.ravel()
      memory[..., 1] = self.y.ravel()
      polys = self.quads.instances()
  
      # group indices of same coloridx together
      color_indices, counts = np.unique(norm, return_counts=True)
      sorted_indices = np.argsort(norm, axis=None)
  
      offset = 0
      for coloridx, cnt in zip(color_indices, counts):
          indices = sorted_indices[offset : offset + cnt]
          offset += cnt
          painter.setBrush(lut[coloridx])
          for idx in indices:
              drawConvexPolygon(polys[idx])
  
      painter.end()
      return picture
  
imports: import numpy
  from ..None import Qt, colormap
  from ..None import functions
  from ..Qt import QtCore, QtGui
  from .GraphicsObject import GraphicsObject
label_desc: Use image node_id 5 for calling the PColorMeshItem obj's underlying member method code with example usage: obj._drawPicture() and returns: picture