JavaScript
- 1 ответ
- 0 вопросов
1
Вклад в тег
$objWriter->startElement('xdr:oneCellAnchor');
$aResizeProportional = $pDrawing->getResizeProportional();
if ($aResizeProportional) {
$objWriter->startElement('xdr:twoCellAnchor');
}
else {
$objWriter->startElement('xdr:oneCellAnchor');
}
// 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();
if ($aResizeProportional) {
$objWriter->startElement('xdr:to');
$objWriter->writeElement('xdr:col', $aCoordinates[0] - 1);
$objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetX()) + PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getWidth()));
$objWriter->writeElement('xdr:row', $aCoordinates[1] - 1);
$objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetY()) + PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getHeight()));
$objWriter->endElement();
} else {
// 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();
}
$objDrawing->setWidth($width);
$objDrawing->setHeight($height);
$objDrawing->setResizeProportional(true);
$objDrawing->setWidthAndHeight($width,$height);