ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Worksheet_MemoryDrawing Class Reference
+ Inheritance diagram for PHPExcel_Worksheet_MemoryDrawing:
+ Collaboration diagram for PHPExcel_Worksheet_MemoryDrawing:

Public Member Functions

 __construct ()
 Create a new PHPExcel_Worksheet_MemoryDrawing.
 getImageResource ()
 Get image resource.
 setImageResource ($value=null)
 Set image resource.
 getRenderingFunction ()
 Get rendering function.
 setRenderingFunction ($value=PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT)
 Set rendering function.
 getMimeType ()
 Get mime type.
 setMimeType ($value=PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT)
 Set mime type.
 getIndexedFilename ()
 Get indexed filename (using image index)
 getHashCode ()
 Get hash code.
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy.
- Public Member Functions inherited from PHPExcel_Worksheet_BaseDrawing
 getImageIndex ()
 Get image index.
 getName ()
 Get Name.
 setName ($pValue= '')
 Set Name.
 getDescription ()
 Get Description.
 setDescription ($pValue= '')
 Set Description.
 getWorksheet ()
 Get Worksheet.
 setWorksheet (PHPExcel_Worksheet $pValue=null, $pOverrideOld=false)
 Set Worksheet.
 getCoordinates ()
 Get Coordinates.
 setCoordinates ($pValue= 'A1')
 Set Coordinates.
 getOffsetX ()
 Get OffsetX.
 setOffsetX ($pValue=0)
 Set OffsetX.
 getOffsetY ()
 Get OffsetY.
 setOffsetY ($pValue=0)
 Set OffsetY.
 getWidth ()
 Get Width.
 setWidth ($pValue=0)
 Set Width.
 getHeight ()
 Get Height.
 setHeight ($pValue=0)
 Set Height.
 setWidthAndHeight ($width=0, $height=0)
 Set width and height with proportional resize Example: $objDrawing->setResizeProportional(true); $objDrawing->setWidthAndHeight(160,120);
 getResizeProportional ()
 Get ResizeProportional.
 setResizeProportional ($pValue=true)
 Set ResizeProportional.
 getRotation ()
 Get Rotation.
 setRotation ($pValue=0)
 Set Rotation.
 getShadow ()
 Get Shadow.
 setShadow (PHPExcel_Worksheet_Drawing_Shadow $pValue=null)
 Set Shadow.

Data Fields

const RENDERING_DEFAULT = 'imagepng'
const RENDERING_PNG = 'imagepng'
const RENDERING_GIF = 'imagegif'
const RENDERING_JPEG = 'imagejpeg'
const MIMETYPE_DEFAULT = 'image/png'
const MIMETYPE_PNG = 'image/png'
const MIMETYPE_GIF = 'image/gif'
const MIMETYPE_JPEG = 'image/jpeg'

Private Attributes

 $_imageResource
 $_renderingFunction
 $_mimeType
 $_uniqueName

Additional Inherited Members

- Protected Attributes inherited from PHPExcel_Worksheet_BaseDrawing
 $_name
 $_description
 $_worksheet
 $_coordinates
 $_offsetX
 $_offsetY
 $_width
 $_height
 $_resizeProportional
 $_rotation
 $_shadow

Detailed Description

Definition at line 36 of file MemoryDrawing.php.

Constructor & Destructor Documentation

PHPExcel_Worksheet_MemoryDrawing::__construct ( )

Create a new PHPExcel_Worksheet_MemoryDrawing.

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 81 of file MemoryDrawing.php.

References MIMETYPE_DEFAULT, and RENDERING_DEFAULT.

{
// Initialise values
$this->_imageResource = null;
$this->_renderingFunction = self::RENDERING_DEFAULT;
$this->_mimeType = self::MIMETYPE_DEFAULT;
$this->_uniqueName = md5(rand(0, 9999). time() . rand(0, 9999));
// Initialize parent
}

Member Function Documentation

PHPExcel_Worksheet_MemoryDrawing::__clone ( )

Implement PHP __clone to create a deep clone, not just a shallow copy.

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 190 of file MemoryDrawing.php.

{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
PHPExcel_Worksheet_MemoryDrawing::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PHPExcel_IComparable.

Definition at line 177 of file MemoryDrawing.php.

{
return md5(
$this->_renderingFunction
. $this->_mimeType
. $this->_uniqueName
. parent::getHashCode()
. __CLASS__
);
}
PHPExcel_Worksheet_MemoryDrawing::getImageResource ( )

Get image resource.

Returns
resource

Definition at line 98 of file MemoryDrawing.php.

References $_imageResource.

{
}
PHPExcel_Worksheet_MemoryDrawing::getIndexedFilename ( )

Get indexed filename (using image index)

Returns
string

Definition at line 164 of file MemoryDrawing.php.

References PHPExcel_Worksheet_BaseDrawing\getImageIndex(), and getMimeType().

{
$extension = strtolower($this->getMimeType());
$extension = explode('/', $extension);
$extension = $extension[1];
return $this->_uniqueName . $this->getImageIndex() . '.' . $extension;
}

+ Here is the call graph for this function:

PHPExcel_Worksheet_MemoryDrawing::getMimeType ( )

Get mime type.

Returns
string

Definition at line 144 of file MemoryDrawing.php.

References $_mimeType.

Referenced by getIndexedFilename().

{
}

+ Here is the caller graph for this function:

PHPExcel_Worksheet_MemoryDrawing::getRenderingFunction ( )

Get rendering function.

Returns
string

Definition at line 124 of file MemoryDrawing.php.

References $_renderingFunction.

PHPExcel_Worksheet_MemoryDrawing::setImageResource (   $value = null)

Set image resource.

Parameters
$valueresource
Returns
PHPExcel_Worksheet_MemoryDrawing

Definition at line 108 of file MemoryDrawing.php.

{
$this->_imageResource = $value;
if (!is_null($this->_imageResource)) {
// Get width/height
$this->_width = imagesx($this->_imageResource);
$this->_height = imagesy($this->_imageResource);
}
return $this;
}
PHPExcel_Worksheet_MemoryDrawing::setMimeType (   $value = PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT)

Set mime type.

Parameters
string$value
Returns
PHPExcel_Worksheet_MemoryDrawing

Definition at line 154 of file MemoryDrawing.php.

{
$this->_mimeType = $value;
return $this;
}
PHPExcel_Worksheet_MemoryDrawing::setRenderingFunction (   $value = PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT)

Set rendering function.

Parameters
string$value
Returns
PHPExcel_Worksheet_MemoryDrawing

Definition at line 134 of file MemoryDrawing.php.

{
$this->_renderingFunction = $value;
return $this;
}

Field Documentation

PHPExcel_Worksheet_MemoryDrawing::$_imageResource
private

Definition at line 55 of file MemoryDrawing.php.

Referenced by getImageResource().

PHPExcel_Worksheet_MemoryDrawing::$_mimeType
private

Definition at line 69 of file MemoryDrawing.php.

Referenced by getMimeType().

PHPExcel_Worksheet_MemoryDrawing::$_renderingFunction
private

Definition at line 62 of file MemoryDrawing.php.

Referenced by getRenderingFunction().

PHPExcel_Worksheet_MemoryDrawing::$_uniqueName
private

Definition at line 76 of file MemoryDrawing.php.

const PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT = 'image/png'

Definition at line 45 of file MemoryDrawing.php.

Referenced by __construct().

const PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_GIF = 'image/gif'

Definition at line 47 of file MemoryDrawing.php.

const PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_JPEG = 'image/jpeg'

Definition at line 48 of file MemoryDrawing.php.

Referenced by PHPExcel_Reader_Excel5\load().

const PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_PNG = 'image/png'

Definition at line 46 of file MemoryDrawing.php.

Referenced by PHPExcel_Reader_Excel5\load().

const PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT = 'imagepng'

Definition at line 39 of file MemoryDrawing.php.

Referenced by __construct(), and PHPExcel_Writer_Excel5\_buildWorkbookEscher().

const PHPExcel_Worksheet_MemoryDrawing::RENDERING_GIF = 'imagegif'

Definition at line 41 of file MemoryDrawing.php.

Referenced by PHPExcel_Writer_Excel5\_buildWorkbookEscher().

const PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG = 'imagejpeg'
const PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG = 'imagepng'

The documentation for this class was generated from the following file: