Constants

RENDERING_DEFAULT

RENDERING_DEFAULT = 'imagepng'

RENDERING_PNG

RENDERING_PNG = 'imagepng'

RENDERING_GIF

RENDERING_GIF = 'imagegif'

RENDERING_JPEG

RENDERING_JPEG = 'imagejpeg'

MIMETYPE_DEFAULT

MIMETYPE_DEFAULT = 'image/png'

MIMETYPE_PNG

MIMETYPE_PNG = 'image/png'

MIMETYPE_GIF

MIMETYPE_GIF = 'image/gif'

MIMETYPE_JPEG

MIMETYPE_JPEG = 'image/jpeg'

Properties

$name

$name : string

Name.

Type

string

$description

$description : string

Description.

Type

string

$worksheet

$worksheet : \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Worksheet.

Type

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

$coordinates

$coordinates : string

Coordinates.

Type

string

$offsetX

$offsetX : integer

Offset X.

Type

integer

$offsetY

$offsetY : integer

Offset Y.

Type

integer

$width

$width : integer

Width.

Type

integer

$height

$height : integer

Height.

Type

integer

$resizeProportional

$resizeProportional : boolean

Proportional resize.

Type

boolean

$rotation

$rotation : integer

Rotation.

Type

integer

$imageCounter

$imageCounter : integer

Image counter.

Type

integer

$imageIndex

$imageIndex : integer

Image index.

Type

integer

$imageResource

$imageResource : resource

Image resource.

Type

resource

$renderingFunction

$renderingFunction : string

Rendering function.

Type

string

$mimeType

$mimeType : string

Mime type.

Type

string

$uniqueName

$uniqueName : string

Unique name.

Type

string

Methods

__construct()

__construct() 

Create a new MemoryDrawing.

getImageIndex()

getImageIndex() : integer

Get image index.

Returns

integer

getName()

getName() : string

Get Name.

Returns

string

setName()

setName(string  $pValue) : $this

Set Name.

Parameters

string $pValue

Returns

$this

getDescription()

getDescription() : string

Get Description.

Returns

string

setDescription()

setDescription(string  $description) : $this

Set Description.

Parameters

string $description

Returns

$this

getWorksheet()

getWorksheet() : \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Get Worksheet.

Returns

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

setWorksheet()

setWorksheet(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $pValue = null, boolean  $pOverrideOld = false) : $this

Set Worksheet.

Parameters

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pValue
boolean $pOverrideOld

If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet?

Throws

\PhpOffice\PhpSpreadsheet\Exception

Returns

$this

getCoordinates()

getCoordinates() : string

Get Coordinates.

Returns

string

setCoordinates()

setCoordinates(string  $pValue) : $this

Set Coordinates.

Parameters

string $pValue

eg: 'A1'

Returns

$this

getOffsetX()

getOffsetX() : integer

Get OffsetX.

Returns

integer

setOffsetX()

setOffsetX(integer  $pValue) : $this

Set OffsetX.

Parameters

integer $pValue

Returns

$this

getOffsetY()

getOffsetY() : integer

Get OffsetY.

Returns

integer

setOffsetY()

setOffsetY(integer  $pValue) : $this

Set OffsetY.

Parameters

integer $pValue

Returns

$this

getWidth()

getWidth() : integer

Get Width.

Returns

integer

setWidth()

setWidth(integer  $pValue) : $this

Set Width.

Parameters

integer $pValue

Returns

$this

getHeight()

getHeight() : integer

Get Height.

Returns

integer

setHeight()

setHeight(integer  $pValue) : $this

Set Height.

Parameters

integer $pValue

Returns

$this

setWidthAndHeight()

setWidthAndHeight(integer  $width, integer  $height) : $this

Set width and height with proportional resize.

Example: $objDrawing->setResizeProportional(true); $objDrawing->setWidthAndHeight(160,120);

Parameters

integer $width
integer $height

Returns

$this

getResizeProportional()

getResizeProportional() : boolean

Get ResizeProportional.

Returns

boolean

setResizeProportional()

setResizeProportional(boolean  $pValue) : $this

Set ResizeProportional.

Parameters

boolean $pValue

Returns

$this

getRotation()

getRotation() : integer

Get Rotation.

Returns

integer

setRotation()

setRotation(integer  $pValue) : $this

Set Rotation.

Parameters

integer $pValue

Returns

$this

getHashCode()

getHashCode() : string

Get hash code.

Returns

string —

Hash code

__clone()

__clone() 

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

getImageResource()

getImageResource() : resource

Get image resource.

Returns

resource

setImageResource()

setImageResource(resource  $value) : $this

Set image resource.

Parameters

resource $value

Returns

$this

getRenderingFunction()

getRenderingFunction() : string

Get rendering function.

Returns

string

setRenderingFunction()

setRenderingFunction(string  $value) : $this

Set rendering function.

Parameters

string $value

see self::RENDERING_*

Returns

$this

getMimeType()

getMimeType() : string

Get mime type.

Returns

string

setMimeType()

setMimeType(string  $value) : $this

Set mime type.

Parameters

string $value

see self::MIMETYPE_*

Returns

$this

getIndexedFilename()

getIndexedFilename() : string

Get indexed filename (using image index).

Returns

string