Home > Backend Development > PHP Tutorial > PHPExcel导出图片大小设置有关问题

PHPExcel导出图片大小设置有关问题

WBOY
Release: 2016-06-13 13:10:30
Original
1739 people have browsed it

PHPExcel导出图片大小设置问题
使用PHPExcel导出图片到excel的时候,图片大小只会按照一定的比例显示,不能按照自己的要求显示大小,不知道怎么解决,有哪位大神帮下我吗?
$objDrawing = new PHPExcel_Worksheet_Drawing(); 
$objDrawing->setName('Photo'); 
$objDrawing->setDescription('Image inserted by pyxjm'); 
$objDrawing->setPath('.'.$data['lic_litpic']); 
$objDrawing->setWidth('122pt');
$objDrawing->setHeight('200pt');
$objDrawing->setCoordinates('G2');
$objDrawing->setOffsetX(2);
$objDrawing->getShadow()->setVisible(true); 
//$objDrawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT);
$objDrawing->setWorksheet($objPHPExcel->getActiveSheet());

------解决方案--------------------
$objDrawing->setHeight(122);//照片高度
$objDrawing->setWidth(200); //照片宽度

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template