\PhpOffice\PhpSpreadsheet\SharedDrawing

Summary

Methods
Properties
Constants
pixelsToEMU()
EMUToPixels()
pixelsToCellDimension()
cellDimensionToPixels()
pixelsToPoints()
pointsToPixels()
degreesToAngle()
angleToDegrees()
imagecreatefrombmp()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

pixelsToEMU()

pixelsToEMU(int  $pValue) : int

Convert pixels to EMU.

Parameters

int $pValue

Value in pixels

Returns

int —

Value in EMU

EMUToPixels()

EMUToPixels(int  $pValue) : int

Convert EMU to pixels.

Parameters

int $pValue

Value in EMU

Returns

int —

Value in pixels

pixelsToCellDimension()

pixelsToCellDimension(int  $pValue, \PhpOffice\PhpSpreadsheet\Style\Font  $pDefaultFont) : int

Convert pixels to column width. Exact algorithm not known.

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

int $pValue

Value in pixels

\PhpOffice\PhpSpreadsheet\Style\Font $pDefaultFont

Default font of the workbook

Returns

int —

Value in cell dimension

cellDimensionToPixels()

cellDimensionToPixels(float  $pValue, \PhpOffice\PhpSpreadsheet\Style\Font  $pDefaultFont) : int

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

Parameters

float $pValue

Value in cell dimension

\PhpOffice\PhpSpreadsheet\Style\Font $pDefaultFont

Default font of the workbook

Returns

int —

Value in pixels

pixelsToPoints()

pixelsToPoints(int  $pValue) : float

Convert pixels to points.

Parameters

int $pValue

Value in pixels

Returns

float —

Value in points

pointsToPixels()

pointsToPixels(int  $pValue) : int

Convert points to pixels.

Parameters

int $pValue

Value in points

Returns

int —

Value in pixels

degreesToAngle()

degreesToAngle(int  $pValue) : int

Convert degrees to angle.

Parameters

int $pValue

Degrees

Returns

int —

Angle

angleToDegrees()

angleToDegrees(int  $pValue) : int

Convert angle to degrees.

Parameters

int $pValue

Angle

Returns

int —

Degrees

imagecreatefrombmp()

imagecreatefrombmp(string  $p_sFile) : \GdImage|resource

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

Parameters

string $p_sFile

Path to Windows DIB (BMP) image

Returns

\GdImage|resource —