code: func (im *Image) CreatePixmap() error {
  	// Generate the pixmap id.
  	pid, err := xproto.NewPixmapId(im.X.Conn())
  	if err != nil {
  		return err
  	}
  
  	// Now actually create the pixmap.
  	err = xproto.CreatePixmapChecked(im.X.Conn(), im.X.Screen().RootDepth,
  		pid, xproto.Drawable(im.X.RootWin()),
  		uint16(im.Bounds().Dx()), uint16(im.Bounds().Dy())).Check()
  	if err != nil {
  		return err
  	}
  
  	// Now give it to the image.
  	im.Pixmap = pid
  	return nil
  }
docs: // CreatePixmap allocates an X resource identifier for a pixmap. (It does not
  // do any drawing.) You only need to call this if you're using XDraw/XExpPaint.
  // If you're using XSurfaceSet/XDraw/XPaint, then CreatePixmap is called for
  // you automatically.