MemoryDrawing
extends BaseDrawing
in package
Table of Contents
Constants
- EDIT_AS_ABSOLUTE = 'absolute'
- EDIT_AS_ONECELL = 'oneCell'
- EDIT_AS_TWOCELL = 'twoCell'
- MIMETYPE_DEFAULT = 'image/png'
- MIMETYPE_GIF = 'image/gif'
- MIMETYPE_JPEG = 'image/jpeg'
- MIMETYPE_PNG = 'image/png'
- RENDERING_DEFAULT = 'imagepng'
- RENDERING_GIF = 'imagegif'
- RENDERING_JPEG = 'imagejpeg'
- RENDERING_PNG = 'imagepng'
- SUPPORTED_MIME_TYPES = [self::MIMETYPE_GIF, self::MIMETYPE_JPEG, self::MIMETYPE_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.
- $opacity : int|null
- Percentage multiplied by 100,000, e.g. 40% = 40,000.
- $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.
- $imageResource : null|GdImage
- Image resource.
- $mimeType : string
- Mime type.
- $renderingFunction : string
- Rendering function.
- $uniqueName : string
- Unique name.
Methods
- __clone() : mixed
- Implement PHP __clone to create a deep clone, not just a shallow copy.
- __construct() : mixed
- Create a new MemoryDrawing.
- __destruct() : mixed
- fromStream() : self
- fromString() : self
- getCoordinates() : string
- getCoordinates2() : string
- getDescription() : string
- getEditAs() : string
- getFlipHorizontal() : bool
- getFlipVertical() : bool
- getHashCode() : string
- Get hash code.
- getHeight() : int
- getHyperlink() : Hyperlink|null
- getImageHeight() : int
- getImageIndex() : int
- getImageResource() : GdImage|null
- Get image resource.
- getImageWidth() : int
- getIndexedFilename() : string
- Get indexed filename (using image index).
- getMimeType() : string
- Get mime type.
- getName() : string
- getOffsetX() : int
- getOffsetX2() : int
- getOffsetY() : int
- getOffsetY2() : int
- getOpacity() : int|null
- getRenderingFunction() : string
- Get rendering function.
- 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
- setImageResource() : $this
- Set image resource.
- setMimeType() : $this
- Set mime type.
- setName() : self
- setOffsetX() : self
- setOffsetX2() : self
- setOffsetY() : self
- setOffsetY2() : self
- setOpacity() : self
- setRenderingFunction() : $this
- Set rendering function.
- 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.
- cloneResource() : void
- identifyMimeType() : string
- identifyMimeTypeUsingExif() : string|null
- identifyMimeTypeUsingGd() : string|null
- identifyRenderingFunction() : string
- supportedMimeTypes() : string|null
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'
MIMETYPE_DEFAULT
public
mixed
MIMETYPE_DEFAULT
= 'image/png'
MIMETYPE_GIF
public
mixed
MIMETYPE_GIF
= 'image/gif'
MIMETYPE_JPEG
public
mixed
MIMETYPE_JPEG
= 'image/jpeg'
MIMETYPE_PNG
public
mixed
MIMETYPE_PNG
= 'image/png'
RENDERING_DEFAULT
public
mixed
RENDERING_DEFAULT
= 'imagepng'
RENDERING_GIF
public
mixed
RENDERING_GIF
= 'imagegif'
RENDERING_JPEG
public
mixed
RENDERING_JPEG
= 'imagejpeg'
RENDERING_PNG
public
mixed
RENDERING_PNG
= 'imagepng'
SUPPORTED_MIME_TYPES
public
mixed
SUPPORTED_MIME_TYPES
= [self::MIMETYPE_GIF, self::MIMETYPE_JPEG, self::MIMETYPE_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
$flipVertical
protected
bool
$flipVertical
= false
$height
Height.
protected
int
$height
= 0
$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
$name
Name.
protected
string
$name
= ''
$offsetX
Offset X.
protected
int
$offsetX
= 0
$offsetX2
Offset X2.
protected
int
$offsetX2
= 0
$offsetY
Offset Y.
protected
int
$offsetY
= 0
$offsetY2
Offset Y2.
protected
int
$offsetY2
= 0
$opacity
Percentage multiplied by 100,000, e.g. 40% = 40,000.
protected
int|null
$opacity
= null
Opacity=x is the same as transparency=100000-x.
$resizeProportional
Proportional resize.
protected
bool
$resizeProportional
= true
$rotation
Rotation.
protected
int
$rotation
= 0
$shadow
Shadow.
protected
Shadow
$shadow
$srcRect
protected
null|SimpleXMLElement|array<string|int, string>
$srcRect
= []
$type
Image type.
protected
int
$type
= IMAGETYPE_UNKNOWN
$width
Width.
protected
int
$width
= 0
$worksheet
Worksheet.
protected
Worksheet|null
$worksheet
= null
$hyperlink
Image hyperlink.
private
Hyperlink|null
$hyperlink
= null
$imageCounter
Image counter.
private
static int
$imageCounter
= 0
$imageIndex
Image index.
private
int
$imageIndex
$imageResource
Image resource.
private
null|GdImage
$imageResource
= null
$mimeType
Mime type.
private
string
$mimeType
$renderingFunction
Rendering function.
private
string
$renderingFunction
$uniqueName
Unique name.
private
string
$uniqueName
Methods
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
public
__clone() : mixed
__construct()
Create a new MemoryDrawing.
public
__construct() : mixed
__destruct()
public
__destruct() : mixed
fromStream()
public
static fromStream(resource $imageStream) : self
Parameters
- $imageStream : resource
-
Stream data to be converted to a Memory Drawing
Tags
Return values
selffromString()
public
static fromString(string $imageString) : self
Parameters
- $imageString : string
-
String data to be converted to a Memory Drawing
Tags
Return values
selfgetCoordinates()
public
getCoordinates() : string
Return values
stringgetCoordinates2()
public
getCoordinates2() : string
Return values
stringgetDescription()
public
getDescription() : string
Return values
stringgetEditAs()
public
getEditAs() : string
Return values
stringgetFlipHorizontal()
public
getFlipHorizontal() : bool
Return values
boolgetFlipVertical()
public
getFlipVertical() : bool
Return values
boolgetHashCode()
Get hash code.
public
getHashCode() : string
Return values
string —Hash code
getHeight()
public
getHeight() : int
Return values
intgetHyperlink()
public
getHyperlink() : Hyperlink|null
Return values
Hyperlink|nullgetImageHeight()
public
getImageHeight() : int
Return values
intgetImageIndex()
public
getImageIndex() : int
Return values
intgetImageResource()
Get image resource.
public
getImageResource() : GdImage|null
Return values
GdImage|nullgetImageWidth()
public
getImageWidth() : int
Return values
intgetIndexedFilename()
Get indexed filename (using image index).
public
getIndexedFilename() : string
Return values
stringgetMimeType()
Get mime type.
public
getMimeType() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetOffsetX()
public
getOffsetX() : int
Return values
intgetOffsetX2()
public
getOffsetX2() : int
Return values
intgetOffsetY()
public
getOffsetY() : int
Return values
intgetOffsetY2()
public
getOffsetY2() : int
Return values
intgetOpacity()
public
getOpacity() : int|null
Return values
int|nullgetRenderingFunction()
Get rendering function.
public
getRenderingFunction() : string
Return values
stringgetResizeProportional()
public
getResizeProportional() : bool
Return values
boolgetRotation()
public
getRotation() : int
Return values
intgetShadow()
public
getShadow() : Shadow
Return values
ShadowgetSrcRect()
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
intgetWidth()
public
getWidth() : int
Return values
intgetWorksheet()
public
getWorksheet() : Worksheet|null
Return values
Worksheet|nullsetCoordinates()
public
setCoordinates(string $coordinates) : self
Parameters
- $coordinates : string
Return values
selfsetCoordinates2()
public
setCoordinates2(string $coordinates2) : self
Parameters
- $coordinates2 : string
Return values
selfsetDescription()
public
setDescription(string $description) : self
Parameters
- $description : string
Return values
selfsetEditAs()
public
setEditAs(string $editAs) : self
Parameters
- $editAs : string
Return values
selfsetFlipHorizontal()
public
setFlipHorizontal(bool $flipHorizontal) : self
Parameters
- $flipHorizontal : bool
Return values
selfsetFlipVertical()
public
setFlipVertical(bool $flipVertical) : self
Parameters
- $flipVertical : bool
Return values
selfsetHeight()
public
setHeight(int $height) : self
Parameters
- $height : int
Return values
selfsetHyperlink()
public
setHyperlink([Hyperlink|null $hyperlink = null ]) : void
Parameters
- $hyperlink : Hyperlink|null = null
setImageResource()
Set image resource.
public
setImageResource(GdImage|null $value) : $this
Parameters
- $value : GdImage|null
Return values
$thissetMimeType()
Set mime type.
public
setMimeType(string $value) : $this
Parameters
- $value : string
-
see self::MIMETYPE_*
Return values
$thissetName()
public
setName(string $name) : self
Parameters
- $name : string
Return values
selfsetOffsetX()
public
setOffsetX(int $offsetX) : self
Parameters
- $offsetX : int
Return values
selfsetOffsetX2()
public
setOffsetX2(int $offsetX2) : self
Parameters
- $offsetX2 : int
Return values
selfsetOffsetY()
public
setOffsetY(int $offsetY) : self
Parameters
- $offsetY : int
Return values
selfsetOffsetY2()
public
setOffsetY2(int $offsetY2) : self
Parameters
- $offsetY2 : int
Return values
selfsetOpacity()
public
setOpacity(int|null $opacity) : self
Parameters
- $opacity : int|null
Return values
selfsetRenderingFunction()
Set rendering function.
public
setRenderingFunction(string $value) : $this
Parameters
- $value : string
-
see self::RENDERING_*
Return values
$thissetResizeProportional()
public
setResizeProportional(bool $resizeProportional) : self
Parameters
- $resizeProportional : bool
Return values
selfsetRotation()
public
setRotation(int $rotation) : self
Parameters
- $rotation : int
Return values
selfsetShadow()
public
setShadow([Shadow|null $shadow = null ]) : self
Parameters
- $shadow : Shadow|null = null
Return values
selfsetSrcRect()
public
setSrcRect(null|SimpleXMLElement|array<string|int, string> $srcRect) : self
Parameters
- $srcRect : null|SimpleXMLElement|array<string|int, string>
Return values
selfsetWidth()
public
setWidth(int $width) : self
Parameters
- $width : int
Return values
selfsetWidthAndHeight()
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
Return values
selfsetWorksheet()
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
selfvalidEditAs()
public
validEditAs() : bool
Return values
boolsetSizesAndType()
Set Fact Sizes and Type of Image.
protected
setSizesAndType(string $path) : void
Parameters
- $path : string
cloneResource()
private
cloneResource() : void
identifyMimeType()
private
static identifyMimeType(string $imageString) : string
Parameters
- $imageString : string
Tags
Return values
stringidentifyMimeTypeUsingExif()
private
static identifyMimeTypeUsingExif(string $temporaryFileName) : string|null
Parameters
- $temporaryFileName : string
Return values
string|nullidentifyMimeTypeUsingGd()
private
static identifyMimeTypeUsingGd(string $temporaryFileName) : string|null
Parameters
- $temporaryFileName : string
Return values
string|nullidentifyRenderingFunction()
private
static identifyRenderingFunction(string $mimeType) : string
Parameters
- $mimeType : string
Return values
stringsupportedMimeTypes()
private
static supportedMimeTypes([string|null $mimeType = null ]) : string|null
Parameters
- $mimeType : string|null = null