1

我正在使用PHP Excel库并遇到问题。

我需要作为超链接插入到单元格图像中。有可能吗,有什么建议吗?

尝试绘制图像

        $image = imagecreatefromjpeg($imagePath);

        $objDrawing = new PHPExcel_Worksheet_MemoryDrawing();        
        $objDrawing->setImageResource($image);        

        $columnLetter = PHPExcel_Cell::stringFromColumnIndex($columnIndex - 1);

        $this->imageColumns[$columnLetter] = 1;

        $coordinate = $columnLetter . $rowIndex;

        $objDrawing->setCoordinates($coordinate);
        $objDrawing->setResizeProportional(false);
        $objDrawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG);
        $objDrawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT);        
        $objDrawing->setWorksheet($this->objPHPExcel->getActiveSheet());
4

0 回答 0