本文整理匯總了PHP中PhpOffice\PhpPresentation\PhpPresentation::setZoom方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhpPresentation::setZoom方法的具體用法?PHP PhpPresentation::setZoom怎麽用?PHP PhpPresentation::setZoom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PhpOffice\PhpPresentation\PhpPresentation
的用法示例。
在下文中一共展示了PhpPresentation::setZoom方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadViewProperties
/**
* Read View Properties
* @param string $sPart
*/
protected function loadViewProperties($sPart)
{
$xmlReader = new XMLReader();
if ($xmlReader->getDomFromString($sPart)) {
$pathZoom = '/p:viewPr/p:slideViewPr/p:cSldViewPr/p:cViewPr/p:scale/a:sx';
if (is_object($oElement = $xmlReader->getElement($pathZoom))) {
if ($oElement->hasAttribute('d') && $oElement->hasAttribute('n')) {
$this->oPhpPresentation->setZoom($oElement->getAttribute('n') / $oElement->getAttribute('d'));
}
}
}
}
示例2: date
<?php
include_once 'Sample_Header.php';
use PhpOffice\PhpPresentation\PhpPresentation;
use PhpOffice\PhpPresentation\Style\Alignment;
use PhpOffice\PhpPresentation\Style\Color;
// Create new PHPPresentation object
echo date('H:i:s') . ' Create new PHPPresentation object' . EOL;
$objPHPPresentation = new PhpPresentation();
// Set the zoom to 200%
$objPHPPresentation->setZoom(3);
// Create slide
echo date('H:i:s') . ' Create slide' . EOL;
$currentSlide = $objPHPPresentation->getActiveSlide();
$currentSlide->addShape(clone $oShapeDrawing);
$currentSlide->addShape(clone $oShapeRichText);
// Save file
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
if (!CLI) {
include_once 'Sample_Footer.php';
}
示例3: testZoom
public function testZoom()
{
$object = new PhpPresentation();
$this->assertEquals(1, $object->getZoom());
$this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->setZoom('AAAA'));
$this->assertEquals(1, $object->getZoom());
$this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->setZoom(2.3));
$this->assertEquals(2.3, $object->getZoom());
$this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->setZoom());
$this->assertEquals(1, $object->getZoom());
}