136 $this->_description =
'';
137 $this->_worksheet = null;
138 $this->_coordinates =
'A1';
143 $this->_resizeProportional =
true;
144 $this->_rotation = 0;
148 self::$_imageCounter++;
149 $this->_imageIndex = self::$_imageCounter;
177 $this->_name = $pValue;
197 $this->_description = $pValue;
219 if (is_null($this->_worksheet)) {
221 $this->_worksheet = $pValue;
222 $this->_worksheet->getCell($this->_coordinates);
223 $this->_worksheet->getDrawingCollection()->append($this);
227 $iterator = $this->_worksheet->getDrawingCollection()->getIterator();
229 while ($iterator->valid()) {
230 if ($iterator->current()->getHashCode() == $this->
getHashCode()) {
231 $this->_worksheet->getDrawingCollection()->offsetUnset( $iterator->key() );
232 $this->_worksheet = null;
240 throw new PHPExcel_Exception(
"A PHPExcel_Worksheet has already been assigned. Drawings can only exist on one PHPExcel_Worksheet.");
262 $this->_coordinates = $pValue;
282 $this->_offsetX = $pValue;
302 $this->_offsetY = $pValue;
323 if ($this->_resizeProportional && $pValue != 0) {
324 $ratio = $this->_height / ($this->_width != 0 ? $this->_width : 1);
325 $this->_height = round($ratio * $pValue);
329 $this->_width = $pValue;
351 if ($this->_resizeProportional && $pValue != 0) {
352 $ratio = $this->_width / ($this->_height != 0 ? $this->_height : 1);
353 $this->_width = round($ratio * $pValue);
357 $this->_height = $pValue;
376 $xratio = $width / ($this->_width != 0 ? $this->_width : 1);
377 $yratio = $height / ($this->_height != 0 ? $this->_height : 1);
378 if ($this->_resizeProportional && !($width == 0 || $height == 0)) {
379 if (($xratio * $this->_height) < $height) {
380 $this->_height = ceil($xratio * $this->_height);
381 $this->_width = $width;
383 $this->_width = ceil($yratio * $this->_width);
384 $this->_height = $height;
387 $this->_width = $width;
388 $this->_height = $height;
410 $this->_resizeProportional = $pValue;
430 $this->_rotation = $pValue;
451 $this->_shadow = $pValue;
463 . $this->_description
464 . $this->_worksheet->getHashCode()
465 . $this->_coordinates
471 . $this->_shadow->getHashCode()
480 $vars = get_object_vars($this);
481 foreach ($vars as
$key => $value) {
482 if (is_object($value)) {
483 $this->
$key = clone $value;
485 $this->
$key = $value;
setOffsetY($pValue=0)
Set OffsetY.
setName($pValue='')
Set Name.
__construct()
Create a new PHPExcel_Worksheet_BaseDrawing.
setWidth($pValue=0)
Set Width.
setOffsetX($pValue=0)
Set OffsetX.
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
setWidthAndHeight($width=0, $height=0)
Set width and height with proportional resize Example: $objDrawing->setResizeProportional(true); $ob...
setCoordinates($pValue='A1')
Set Coordinates.
setRotation($pValue=0)
Set Rotation.
getImageIndex()
Get image index.
setShadow(PHPExcel_Worksheet_Drawing_Shadow $pValue=null)
Set Shadow.
getCoordinates()
Get Coordinates.
getWorksheet()
Get Worksheet.
getHashCode()
Get hash code.
setHeight($pValue=0)
Set Height.
setWorksheet(PHPExcel_Worksheet $pValue=null, $pOverrideOld=false)
Set Worksheet.
getDescription()
Get Description.
setResizeProportional($pValue=true)
Set ResizeProportional.
getResizeProportional()
Get ResizeProportional.
getRotation()
Get Rotation.
setDescription($pValue='')
Set Description.