当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPExcel_Shared_Drawing::pixelsToEMU方法代码示例

本文整理汇总了PHP中PHPExcel_Shared_Drawing::pixelsToEMU方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Shared_Drawing::pixelsToEMU方法的具体用法?PHP PHPExcel_Shared_Drawing::pixelsToEMU怎么用?PHP PHPExcel_Shared_Drawing::pixelsToEMU使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPExcel_Shared_Drawing的用法示例。


在下文中一共展示了PHPExcel_Shared_Drawing::pixelsToEMU方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _writeDrawing

 /**
  * Write drawings to XML format
  *
  * @param 	PHPExcel_Shared_XMLWriter			$objWriter 		XML Writer
  * @param 	PHPExcel_Worksheet_BaseDrawing		$pDrawing
  * @param 	int									$pRelationId
  * @throws 	PHPExcel_Writer_Exception
  */
 public function _writeDrawing(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet_BaseDrawing $pDrawing = null, $pRelationId = -1)
 {
     if ($pRelationId >= 0) {
         // xdr:oneCellAnchor
         $objWriter->startElement('xdr:oneCellAnchor');
         // Image location
         $aCoordinates = PHPExcel_Cell::coordinateFromString($pDrawing->getCoordinates());
         $aCoordinates[0] = PHPExcel_Cell::columnIndexFromString($aCoordinates[0]);
         // xdr:from
         $objWriter->startElement('xdr:from');
         $objWriter->writeElement('xdr:col', $aCoordinates[0] - 1);
         $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetX()));
         $objWriter->writeElement('xdr:row', $aCoordinates[1] - 1);
         $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetY()));
         $objWriter->endElement();
         // xdr:ext
         $objWriter->startElement('xdr:ext');
         $objWriter->writeAttribute('cx', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getWidth()));
         $objWriter->writeAttribute('cy', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getHeight()));
         $objWriter->endElement();
         // xdr:pic
         $objWriter->startElement('xdr:pic');
         // xdr:nvPicPr
         $objWriter->startElement('xdr:nvPicPr');
         // xdr:cNvPr
         $objWriter->startElement('xdr:cNvPr');
         $objWriter->writeAttribute('id', $pRelationId);
         $objWriter->writeAttribute('name', $pDrawing->getName());
         $objWriter->writeAttribute('descr', $pDrawing->getDescription());
         $objWriter->endElement();
         // xdr:cNvPicPr
         $objWriter->startElement('xdr:cNvPicPr');
         // a:picLocks
         $objWriter->startElement('a:picLocks');
         $objWriter->writeAttribute('noChangeAspect', '1');
         $objWriter->endElement();
         $objWriter->endElement();
         $objWriter->endElement();
         // xdr:blipFill
         $objWriter->startElement('xdr:blipFill');
         // a:blip
         $objWriter->startElement('a:blip');
         $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
         $objWriter->writeAttribute('r:embed', 'rId' . $pRelationId);
         $objWriter->endElement();
         // a:stretch
         $objWriter->startElement('a:stretch');
         $objWriter->writeElement('a:fillRect', null);
         $objWriter->endElement();
         $objWriter->endElement();
         // xdr:spPr
         $objWriter->startElement('xdr:spPr');
         // a:xfrm
         $objWriter->startElement('a:xfrm');
         $objWriter->writeAttribute('rot', PHPExcel_Shared_Drawing::degreesToAngle($pDrawing->getRotation()));
         $objWriter->endElement();
         // a:prstGeom
         $objWriter->startElement('a:prstGeom');
         $objWriter->writeAttribute('prst', 'rect');
         // a:avLst
         $objWriter->writeElement('a:avLst', null);
         $objWriter->endElement();
         //						// a:solidFill
         //						$objWriter->startElement('a:solidFill');
         //							// a:srgbClr
         //							$objWriter->startElement('a:srgbClr');
         //							$objWriter->writeAttribute('val', 'FFFFFF');
         ///* SHADE
         //								// a:shade
         //								$objWriter->startElement('a:shade');
         //								$objWriter->writeAttribute('val', '85000');
         //								$objWriter->endElement();
         //*/
         //							$objWriter->endElement();
         //						$objWriter->endElement();
         /*
         						// a:ln
         						$objWriter->startElement('a:ln');
         						$objWriter->writeAttribute('w', '88900');
         						$objWriter->writeAttribute('cap', 'sq');
         
         							// a:solidFill
         							$objWriter->startElement('a:solidFill');
         
         								// a:srgbClr
         								$objWriter->startElement('a:srgbClr');
         								$objWriter->writeAttribute('val', 'FFFFFF');
         								$objWriter->endElement();
         
         							$objWriter->endElement();
         
         							// a:miter
//.........这里部分代码省略.........
开发者ID:nmalservet,项目名称:biocap,代码行数:101,代码来源:Drawing.php

示例2: _writeChart

 /**
  * Write drawings to XML format
  *
  * @param    PHPExcel_Shared_XMLWriter $objWriter XML Writer
  * @param    PHPExcel_Chart            $pChart
  * @param    int                       $pRelationId
  *
  * @throws    PHPExcel_Writer_Exception
  */
 public function _writeChart(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Chart $pChart = null, $pRelationId = -1)
 {
     $tl = $pChart->getTopLeftPosition();
     $tl['colRow'] = PHPExcel_Cell::coordinateFromString($tl['cell']);
     $br = $pChart->getBottomRightPosition();
     $br['colRow'] = PHPExcel_Cell::coordinateFromString($br['cell']);
     $objWriter->startElement('xdr:twoCellAnchor');
     $objWriter->startElement('xdr:from');
     $objWriter->writeElement('xdr:col', PHPExcel_Cell::columnIndexFromString($tl['colRow'][0]) - 1);
     $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($tl['xOffset']));
     $objWriter->writeElement('xdr:row', $tl['colRow'][1] - 1);
     $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($tl['yOffset']));
     $objWriter->endElement();
     $objWriter->startElement('xdr:to');
     $objWriter->writeElement('xdr:col', PHPExcel_Cell::columnIndexFromString($br['colRow'][0]) - 1);
     $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($br['xOffset']));
     $objWriter->writeElement('xdr:row', $br['colRow'][1] - 1);
     $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($br['yOffset']));
     $objWriter->endElement();
     $objWriter->startElement('xdr:graphicFrame');
     $objWriter->writeAttribute('macro', '');
     $objWriter->startElement('xdr:nvGraphicFramePr');
     $objWriter->startElement('xdr:cNvPr');
     $objWriter->writeAttribute('name', 'Chart ' . $pRelationId);
     $objWriter->writeAttribute('id', 1025 * $pRelationId);
     $objWriter->endElement();
     $objWriter->startElement('xdr:cNvGraphicFramePr');
     $objWriter->startElement('a:graphicFrameLocks');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->startElement('xdr:xfrm');
     $objWriter->startElement('a:off');
     $objWriter->writeAttribute('x', '0');
     $objWriter->writeAttribute('y', '0');
     $objWriter->endElement();
     $objWriter->startElement('a:ext');
     $objWriter->writeAttribute('cx', '0');
     $objWriter->writeAttribute('cy', '0');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->startElement('a:graphic');
     $objWriter->startElement('a:graphicData');
     $objWriter->writeAttribute('uri', 'http://schemas.openxmlformats.org/drawingml/2006/chart');
     $objWriter->startElement('c:chart');
     $objWriter->writeAttribute('xmlns:c', 'http://schemas.openxmlformats.org/drawingml/2006/chart');
     $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
     $objWriter->writeAttribute('r:id', 'rId' . $pRelationId);
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->startElement('xdr:clientData');
     $objWriter->endElement();
     $objWriter->endElement();
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:65,代码来源:Drawing.php


注:本文中的PHPExcel_Shared_Drawing::pixelsToEMU方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。