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

Worksheet

$coordinates

$coordinates : string

Coordinates.

Type

string

$offsetX

$offsetX : int

Offset X.

Type

int

$offsetY

$offsetY : int

Offset Y.

Type

int

$width

$width : int

Width.

Type

int

$height

$height : int

Height.

Type

int

$resizeProportional

$resizeProportional : bool

Proportional resize.

Type

bool

$rotation

$rotation : int

Rotation.

Type

int

$shadow

$shadow : \PhpOffice\PhpSpreadsheet\Worksheet\Drawing\Shadow

Shadow.

Type

Shadow

$imageCounter

$imageCounter : int

Image counter.

Type

int

$imageIndex

$imageIndex : int

Image index.

Type

int

$hyperlink

$hyperlink : null|\PhpOffice\PhpSpreadsheet\Cell\Hyperlink

Image hyperlink.

Type

Hyperlink

$imageResource

$imageResource : \GdImage|resource

Image resource.

Type

GdImage|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() : mixed

Create a new MemoryDrawing.

Returns

mixed —

getImageIndex()

getImageIndex() : int

Get image index.

Returns

int —

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, bool  $pOverrideOld = false) : $this

Set Worksheet.

Parameters

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pValue
bool $pOverrideOld

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

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() : int

Get OffsetX.

Returns

int —

setOffsetX()

setOffsetX(int  $pValue) : $this

Set OffsetX.

Parameters

int $pValue

Returns

$this —

getOffsetY()

getOffsetY() : int

Get OffsetY.

Returns

int —

setOffsetY()

setOffsetY(int  $pValue) : $this

Set OffsetY.

Parameters

int $pValue

Returns

$this —

getWidth()

getWidth() : int

Get Width.

Returns

int —

setWidth()

setWidth(int  $pValue) : $this

Set Width.

Parameters

int $pValue

Returns

$this —

getHeight()

getHeight() : int

Get Height.

Returns

int —

setHeight()

setHeight(int  $pValue) : $this

Set Height.

Parameters

int $pValue

Returns

$this —

setWidthAndHeight()

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

Set width and height with proportional resize.

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

Parameters

int $width
int $height

Returns

$this —

getResizeProportional()

getResizeProportional() : bool

Get ResizeProportional.

Returns

bool —

setResizeProportional()

setResizeProportional(bool  $pValue) : $this

Set ResizeProportional.

Parameters

bool $pValue

Returns

$this —

getRotation()

getRotation() : int

Get Rotation.

Returns

int —

setRotation()

setRotation(int  $pValue) : $this

Set Rotation.

Parameters

int $pValue

Returns

$this —

getShadow()

getShadow() : \PhpOffice\PhpSpreadsheet\Worksheet\Drawing\Shadow

Get Shadow.

Returns

\PhpOffice\PhpSpreadsheet\Worksheet\Drawing\Shadow —

setShadow()

setShadow(\PhpOffice\PhpSpreadsheet\Worksheet\Drawing\Shadow  $pValue = null) : $this

Set Shadow.

Parameters

\PhpOffice\PhpSpreadsheet\Worksheet\Drawing\Shadow $pValue

Returns

$this —

getHashCode()

getHashCode() : string

Get hash code.

Returns

string —

Hash code

__clone()

__clone() : mixed

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

Returns

mixed —

setHyperlink()

setHyperlink(?\PhpOffice\PhpSpreadsheet\Cell\Hyperlink  $pHyperlink = null) : void

Parameters

?\PhpOffice\PhpSpreadsheet\Cell\Hyperlink $pHyperlink

getHyperlink()

getHyperlink() : null|\PhpOffice\PhpSpreadsheet\Cell\Hyperlink

Returns

null|\PhpOffice\PhpSpreadsheet\Cell\Hyperlink —

getImageResource()

getImageResource() : \GdImage|resource

Get image resource.

Returns

\GdImage|resource —

setImageResource()

setImageResource(\GdImage|resource  $value) : $this

Set image resource.

Parameters

\GdImage|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 —