Documentation

Drawing

Table of Contents

angleToDegrees()  : int
Convert angle to degrees.
cellDimensionToPixels()  : int
Convert column width from (intrinsic) Excel units to pixels.
degreesToAngle()  : int
Convert degrees to angle.
EMUToPixels()  : int
Convert EMU to pixels.
imagecreatefrombmp()  : GdImage|resource
Create a new image from file. By alexander at alexauto dot nl.
pixelsToCellDimension()  : float|int
Convert pixels to column width. Exact algorithm not known.
pixelsToEMU()  : int
Convert pixels to EMU.
pixelsToPoints()  : float
Convert pixels to points.
pointsToPixels()  : int
Convert points to pixels.

Methods

angleToDegrees()

Convert angle to degrees.

public static angleToDegrees(int|SimpleXMLElement $angle) : int
Parameters
$angle : int|SimpleXMLElement

Angle

Return values
int

Degrees

cellDimensionToPixels()

Convert column width from (intrinsic) Excel units to pixels.

public static cellDimensionToPixels(float $cellWidth, Font $defaultFont) : int
Parameters
$cellWidth : float

Value in cell dimension

$defaultFont : Font

Default font of the workbook

Return values
int

Value in pixels

degreesToAngle()

Convert degrees to angle.

public static degreesToAngle(int $degrees) : int
Parameters
$degrees : int

Degrees

Return values
int

Angle

EMUToPixels()

Convert EMU to pixels.

public static EMUToPixels(int|SimpleXMLElement $emuValue) : int
Parameters
$emuValue : int|SimpleXMLElement

Value in EMU

Return values
int

Value in pixels

imagecreatefrombmp()

Create a new image from file. By alexander at alexauto dot nl.

public static imagecreatefrombmp(string $bmpFilename) : GdImage|resource
Parameters
$bmpFilename : string

Path to Windows DIB (BMP) image

Tags
see
http://www.php.net/manual/en/function.imagecreatefromwbmp.php#86214
deprecated
1.26

use Php function imagecreatefrombmp instead

codeCoverageIgnore
Return values
GdImage|resource

pixelsToCellDimension()

Convert pixels to column width. Exact algorithm not known.

public static pixelsToCellDimension(int $pixelValue, Font $defaultFont) : float|int

By inspection of a real Excel file using Calibri 11, one finds 1000px ~ 142.85546875 This gives a conversion factor of 7. Also, we assume that pixels and font size are proportional.

Parameters
$pixelValue : int

Value in pixels

$defaultFont : Font
Return values
float|int

Value in cell dimension

pixelsToEMU()

Convert pixels to EMU.

public static pixelsToEMU(int $pixelValue) : int
Parameters
$pixelValue : int

Value in pixels

Return values
int

Value in EMU

pixelsToPoints()

Convert pixels to points.

public static pixelsToPoints(int $pixelValue) : float
Parameters
$pixelValue : int

Value in pixels

Return values
float

Value in points

pointsToPixels()

Convert points to pixels.

public static pointsToPixels(int $pointValue) : int
Parameters
$pointValue : int

Value in points

Return values
int

Value in pixels

Search results