Documentation

Drawing extends BaseDrawing
in package

Table of Contents

Constants

EDIT_AS_ABSOLUTE  = 'absolute'
EDIT_AS_ONECELL  = 'oneCell'
EDIT_AS_TWOCELL  = 'twoCell'
IMAGE_TYPES_CONVERTION_MAP  = [IMAGETYPE_GIF => IMAGETYPE_PNG, IMAGETYPE_JPEG => IMAGETYPE_JPEG, IMAGETYPE_PNG => IMAGETYPE_PNG, IMAGETYPE_BMP => IMAGETYPE_PNG]
VALID_EDIT_AS  = [self::EDIT_AS_ABSOLUTE, self::EDIT_AS_ONECELL, self::EDIT_AS_TWOCELL]

Properties

$coordinates  : string
Coordinates.
$coordinates2  : string
Coordinates2.
$description  : string
Description.
$editAs  : string
The editAs attribute, used only with two cell anchor.
$flipHorizontal  : bool
$flipVertical  : bool
$height  : int
Height.
$imageHeight  : int
Pixel width of image. See $height for the size the Drawing will be in the sheet.
$imageWidth  : int
Pixel width of image. See $width for the size the Drawing will be in the sheet.
$name  : string
Name.
$offsetX  : int
Offset X.
$offsetX2  : int
Offset X2.
$offsetY  : int
Offset Y.
$offsetY2  : int
Offset Y2.
$resizeProportional  : bool
Proportional resize.
$rotation  : int
Rotation.
$shadow  : Shadow
Shadow.
$srcRect  : null|SimpleXMLElement|array<string|int, string>
$type  : int
Image type.
$width  : int
Width.
$worksheet  : Worksheet|null
Worksheet.
$hyperlink  : Hyperlink|null
Image hyperlink.
$imageCounter  : int
Image counter.
$imageIndex  : int
Image index.
$isUrl  : bool
Whether or not we are dealing with a URL.
$path  : string
Path.

Methods

__clone()  : mixed
Implement PHP __clone to create a deep clone, not just a shallow copy.
__construct()  : mixed
Create a new Drawing.
__destruct()  : mixed
getCoordinates()  : string
getCoordinates2()  : string
getDescription()  : string
getEditAs()  : string
getExtension()  : string
Get Extension.
getFilename()  : string
Get Filename.
getFlipHorizontal()  : bool
getFlipVertical()  : bool
getHashCode()  : string
Get hash code.
getHeight()  : int
getHyperlink()  : Hyperlink|null
getImageFileExtensionForSave()  : string
Get Image file extention for Save.
getImageHeight()  : int
getImageIndex()  : int
getImageMimeType()  : string
Get Image mime type.
getImageTypeForSave()  : int
Get Image Type for Save.
getImageWidth()  : int
getIndexedFilename()  : string
Get indexed filename (using image index).
getIsURL()  : bool
Get isURL.
getMediaFilename()  : string
Get full filepath to store drawing in zip archive.
getName()  : string
getOffsetX()  : int
getOffsetX2()  : int
getOffsetY()  : int
getOffsetY2()  : int
getPath()  : string
Get Path.
getResizeProportional()  : bool
getRotation()  : int
getShadow()  : Shadow
getSrcRect()  : null|SimpleXMLElement|array<string|int, string>
getType()  : int
Get Image Type.
getWidth()  : int
getWorksheet()  : Worksheet|null
setCoordinates()  : self
setCoordinates2()  : self
setDescription()  : self
setEditAs()  : self
setFlipHorizontal()  : self
setFlipVertical()  : self
setHeight()  : self
setHyperlink()  : void
setIsURL()  : $this
Set isURL.
setName()  : self
setOffsetX()  : self
setOffsetX2()  : self
setOffsetY()  : self
setOffsetY2()  : self
setPath()  : $this
Set Path.
setResizeProportional()  : self
setRotation()  : self
setShadow()  : self
setSrcRect()  : self
setWidth()  : self
setWidthAndHeight()  : self
Set width and height with proportional resize.
setWorksheet()  : self
Set Worksheet.
validEditAs()  : bool
setSizesAndType()  : void
Set Fact Sizes and Type of Image.

Constants

EDIT_AS_ABSOLUTE

public mixed EDIT_AS_ABSOLUTE = 'absolute'

EDIT_AS_ONECELL

public mixed EDIT_AS_ONECELL = 'oneCell'

EDIT_AS_TWOCELL

public mixed EDIT_AS_TWOCELL = 'twoCell'

IMAGE_TYPES_CONVERTION_MAP

public mixed IMAGE_TYPES_CONVERTION_MAP = [IMAGETYPE_GIF => IMAGETYPE_PNG, IMAGETYPE_JPEG => IMAGETYPE_JPEG, IMAGETYPE_PNG => IMAGETYPE_PNG, IMAGETYPE_BMP => IMAGETYPE_PNG]

VALID_EDIT_AS

private mixed VALID_EDIT_AS = [self::EDIT_AS_ABSOLUTE, self::EDIT_AS_ONECELL, self::EDIT_AS_TWOCELL]

Properties

$coordinates

Coordinates.

protected string $coordinates = 'A1'

$coordinates2

Coordinates2.

protected string $coordinates2 = ''

$description

Description.

protected string $description = ''

$editAs

The editAs attribute, used only with two cell anchor.

protected string $editAs = ''

$flipHorizontal

protected bool $flipHorizontal = false

$imageHeight

Pixel width of image. See $height for the size the Drawing will be in the sheet.

protected int $imageHeight = 0

$imageWidth

Pixel width of image. See $width for the size the Drawing will be in the sheet.

protected int $imageWidth = 0

$resizeProportional

Proportional resize.

protected bool $resizeProportional = true

$srcRect

protected null|SimpleXMLElement|array<string|int, string> $srcRect = []

$type

Image type.

protected int $type = IMAGETYPE_UNKNOWN

$imageCounter

Image counter.

private static int $imageCounter = 0

$isUrl

Whether or not we are dealing with a URL.

private bool $isUrl

Methods

__clone()

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

public __clone() : mixed

__construct()

Create a new Drawing.

public __construct() : mixed

getCoordinates()

public getCoordinates() : string
Return values
string

getCoordinates2()

public getCoordinates2() : string
Return values
string

getDescription()

public getDescription() : string
Return values
string

getEditAs()

public getEditAs() : string
Return values
string

getExtension()

Get Extension.

public getExtension() : string
Return values
string

getFilename()

Get Filename.

public getFilename() : string
Return values
string

getFlipHorizontal()

public getFlipHorizontal() : bool
Return values
bool

getFlipVertical()

public getFlipVertical() : bool
Return values
bool

getHashCode()

Get hash code.

public getHashCode() : string
Return values
string

Hash code

getHeight()

public getHeight() : int
Return values
int

getImageFileExtensionForSave()

Get Image file extention for Save.

public getImageFileExtensionForSave([bool $includeDot = true ]) : string
Parameters
$includeDot : bool = true
Return values
string

getImageHeight()

public getImageHeight() : int
Return values
int

getImageIndex()

public getImageIndex() : int
Return values
int

getImageMimeType()

Get Image mime type.

public getImageMimeType() : string
Return values
string

getImageTypeForSave()

Get Image Type for Save.

public getImageTypeForSave() : int
Return values
int

getImageWidth()

public getImageWidth() : int
Return values
int

getIndexedFilename()

Get indexed filename (using image index).

public getIndexedFilename() : string
Return values
string

getIsURL()

Get isURL.

public getIsURL() : bool
Return values
bool

getMediaFilename()

Get full filepath to store drawing in zip archive.

public getMediaFilename() : string
Return values
string

getName()

public getName() : string
Return values
string

getOffsetX()

public getOffsetX() : int
Return values
int

getOffsetX2()

public getOffsetX2() : int
Return values
int

getOffsetY()

public getOffsetY() : int
Return values
int

getOffsetY2()

public getOffsetY2() : int
Return values
int

getPath()

Get Path.

public getPath() : string
Return values
string

getResizeProportional()

public getResizeProportional() : bool
Return values
bool

getRotation()

public getRotation() : int
Return values
int

getSrcRect()

public getSrcRect() : null|SimpleXMLElement|array<string|int, string>
Return values
null|SimpleXMLElement|array<string|int, string>

getType()

Get Image Type.

public getType() : int
Return values
int

getWidth()

public getWidth() : int
Return values
int

setCoordinates()

public setCoordinates(string $coordinates) : self
Parameters
$coordinates : string
Return values
self

setCoordinates2()

public setCoordinates2(string $coordinates2) : self
Parameters
$coordinates2 : string
Return values
self

setDescription()

public setDescription(string $description) : self
Parameters
$description : string
Return values
self

setEditAs()

public setEditAs(string $editAs) : self
Parameters
$editAs : string
Return values
self

setFlipHorizontal()

public setFlipHorizontal(bool $flipHorizontal) : self
Parameters
$flipHorizontal : bool
Return values
self

setFlipVertical()

public setFlipVertical(bool $flipVertical) : self
Parameters
$flipVertical : bool
Return values
self

setHeight()

public setHeight(int $height) : self
Parameters
$height : int
Return values
self

setIsURL()

Set isURL.

public setIsURL(bool $isUrl) : $this
Parameters
$isUrl : bool
Return values
$this

setName()

public setName(string $name) : self
Parameters
$name : string
Return values
self

setOffsetX()

public setOffsetX(int $offsetX) : self
Parameters
$offsetX : int
Return values
self

setOffsetX2()

public setOffsetX2(int $offsetX2) : self
Parameters
$offsetX2 : int
Return values
self

setOffsetY()

public setOffsetY(int $offsetY) : self
Parameters
$offsetY : int
Return values
self

setOffsetY2()

public setOffsetY2(int $offsetY2) : self
Parameters
$offsetY2 : int
Return values
self

setPath()

Set Path.

public setPath(string $path[, bool $verifyFile = true ][, ZipArchive|null $zip = null ]) : $this
Parameters
$path : string

File path

$verifyFile : bool = true

Verify file

$zip : ZipArchive|null = null

Zip archive instance

Return values
$this

setResizeProportional()

public setResizeProportional(bool $resizeProportional) : self
Parameters
$resizeProportional : bool
Return values
self

setRotation()

public setRotation(int $rotation) : self
Parameters
$rotation : int
Return values
self

setShadow()

public setShadow([Shadow|null $shadow = null ]) : self
Parameters
$shadow : Shadow|null = null
Return values
self

setSrcRect()

public setSrcRect(null|SimpleXMLElement|array<string|int, string> $srcRect) : self
Parameters
$srcRect : null|SimpleXMLElement|array<string|int, string>
Return values
self

setWidth()

public setWidth(int $width) : self
Parameters
$width : int
Return values
self

setWidthAndHeight()

Set width and height with proportional resize.

public setWidthAndHeight(int $width, int $height) : self

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

Parameters
$width : int
$height : int
Tags
author

Vincent@luo MSN:kele_100@hotmail.com

Return values
self

setWorksheet()

Set Worksheet.

public setWorksheet([Worksheet|null $worksheet = null ][, bool $overrideOld = false ]) : self
Parameters
$worksheet : Worksheet|null = null
$overrideOld : bool = false

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

Return values
self

validEditAs()

public validEditAs() : bool
Return values
bool

setSizesAndType()

Set Fact Sizes and Type of Image.

protected setSizesAndType(string $path) : void
Parameters
$path : string

        
On this page

Search results