Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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

(no description)

File Size: 267 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.

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

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

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

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.

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

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

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

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

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

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

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

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

param: int $degrees Degrees
return: int Angle

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

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

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

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