code: public function insertBitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1)
      {
          $bitmap_array = (is_resource($bitmap) ? $this->processBitmapGd($bitmap) : $this->processBitmap($bitmap));
          list($width, $height, $size, $data) = $bitmap_array;
  
          // Scale the frame of the image.
          $width *= $scale_x;
          $height *= $scale_y;
  
          // Calculate the vertices of the image and write the OBJ record
          $this->positionImage($col, $row, $x, $y, $width, $height);
  
          // Write the IMDATA record to store the bitmap data
          $record = 0x007f;
          $length = 8 + $size;
          $cf = 0x09;
          $env = 0x01;
          $lcb = $size;
  
          $header = pack('vvvvV', $record, $length, $cf, $env, $lcb);
          $this->append($header . $data);
      }
docs: Insert a 24bit bitmap image in a worksheet.
  
  @param int $row The row we are going to insert the bitmap into
  @param int $col The column we are going to insert the bitmap into
  @param mixed $bitmap The bitmap filename or GD-image resource
  @param int $x the horizontal position (offset) of the image inside the cell
  @param int $y the vertical position (offset) of the image inside the cell
  @param float $scale_x The horizontal scale
  @param float $scale_y The vertical scale