class Drawing (View source)

Methods

static int
pixelsToEMU(int $pValue)

Convert pixels to EMU.

static int
EMUToPixels(int $pValue)

Convert EMU to pixels.

static int
pixelsToCellDimension(int $pValue, Font $pDefaultFont)

Convert pixels to column width. Exact algorithm not known.

static int
cellDimensionToPixels(float $pValue, Font $pDefaultFont)

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

static float
pixelsToPoints(int $pValue)

Convert pixels to points.

static int
pointsToPixels(int $pValue)

Convert points to pixels.

static int
degreesToAngle(int $pValue)

Convert degrees to angle.

static int
angleToDegrees(int $pValue)

Convert angle to degrees.

static resource
imagecreatefrombmp(string $p_sFile)

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

Details

static int pixelsToEMU(int $pValue)

Convert pixels to EMU.

Parameters

int $pValue Value in pixels

Return Value

int Value in EMU

static int EMUToPixels(int $pValue)

Convert EMU to pixels.

Parameters

int $pValue Value in EMU

Return Value

int Value in pixels

static int pixelsToCellDimension(int $pValue, Font $pDefaultFont)

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
Font $pDefaultFont Default font of the workbook

Return Value

int Value in cell dimension

static int cellDimensionToPixels(float $pValue, Font $pDefaultFont)

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

Parameters

float $pValue Value in cell dimension
Font $pDefaultFont Default font of the workbook

Return Value

int Value in pixels

static float pixelsToPoints(int $pValue)

Convert pixels to points.

Parameters

int $pValue Value in pixels

Return Value

float Value in points

static int pointsToPixels(int $pValue)

Convert points to pixels.

Parameters

int $pValue Value in points

Return Value

int Value in pixels

static int degreesToAngle(int $pValue)

Convert degrees to angle.

Parameters

int $pValue Degrees

Return Value

int Angle

static int angleToDegrees(int $pValue)

Convert angle to degrees.

Parameters

int $pValue Angle

Return Value

int Degrees

static resource imagecreatefrombmp(string $p_sFile)

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

Parameters

string $p_sFile Path to Windows DIB (BMP) image

Return Value

resource

See also

http://www.php.net/manual/en/function.imagecreatefromwbmp.php#86214