Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

(no description)

File Size: 257 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: Drawing  - X-Ref

pixelsToEMU($pixelValue)   X-Ref
Convert pixels to EMU.

return: int Value in EMU
param: int $pixelValue Value in pixels

EMUToPixels($emuValue)   X-Ref
Convert EMU to pixels.

return: int Value in pixels
param: int|SimpleXMLElement $emuValue Value in EMU

pixelsToCellDimension($pixelValue, \PhpOffice\PhpSpreadsheet\Style\Font $defaultFont)   X-Ref
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.

return: float|int Value in cell dimension
param: int $pixelValue Value in pixels

cellDimensionToPixels($cellWidth, \PhpOffice\PhpSpreadsheet\Style\Font $defaultFont)   X-Ref
Convert column width from (intrinsic) Excel units to pixels.

return: int Value in pixels
param: float $cellWidth Value in cell dimension
param: \PhpOffice\PhpSpreadsheet\Style\Font $defaultFont Default font of the workbook

pixelsToPoints($pixelValue)   X-Ref
Convert pixels to points.

return: float Value in points
param: int $pixelValue Value in pixels

pointsToPixels($pointValue)   X-Ref
Convert points to pixels.

return: int Value in pixels
param: int $pointValue Value in points

degreesToAngle($degrees)   X-Ref
Convert degrees to angle.

return: int Angle
param: int $degrees Degrees

angleToDegrees($angle)   X-Ref
Convert angle to degrees.

return: int Degrees
param: int|SimpleXMLElement $angle Angle

imagecreatefrombmp($bmpFilename)   X-Ref
Create a new image from file. By alexander at alexauto dot nl.

return: GdImage|resource
param: string $bmpFilename Path to Windows DIB (BMP) image