18 return $pValue * 9525;
31 return (
int) round($pValue / 9525);
50 $name = $pDefaultFont->getName();
51 $size = $pDefaultFont->getSize();
76 $name = $pDefaultFont->getName();
77 $size = $pDefaultFont->getSize();
89 $colWidth = (int) round($colWidth);
103 return $pValue * 0.75;
116 return (
int) ceil($pValue / 0.75);
131 return (
int) round($pValue * 60000);
144 return (
int) round($pValue / 60000);
162 $file =
fopen($p_sFile,
'rb');
163 $read = fread($file, 10);
164 while (!feof($file) && ($read !=
'')) {
165 $read .= fread($file, 1024);
168 $temp = unpack(
'H*', $read);
170 $header = substr($hex, 0, 108);
176 if (substr(
$header, 0, 4) ==
'424d') {
178 $header_parts = str_split(
$header, 2);
181 $width = hexdec($header_parts[19] . $header_parts[18]);
184 $height = hexdec($header_parts[23] . $header_parts[22]);
187 unset($header_parts);
195 $image = imagecreatetruecolor($width, $height);
198 $body = substr($hex, 108);
203 $body_size = (strlen($body) / 2);
204 $header_size = ($width * $height);
207 $usePadding = ($body_size > ($header_size * 3) + 4);
211 for (
$i = 0;
$i < $body_size;
$i += 3) {
235 $r = hexdec($body[$i_pos + 4] . $body[$i_pos + 5]);
236 $g = hexdec($body[$i_pos + 2] . $body[$i_pos + 3]);
237 $b = hexdec($body[$i_pos] . $body[$i_pos + 1]);
240 $color = imagecolorallocate($image,
$r, $g, $b);
241 imagesetpixel($image,
$x, $height -
$y, $color);
static angleToDegrees($pValue)
Convert angle to degrees.
static degreesToAngle($pValue)
Convert degrees to angle.
static cellDimensionToPixels($pValue, \PhpOffice\PhpSpreadsheet\Style\Font $pDefaultFont)
Convert column width from (intrinsic) Excel units to pixels.
static pointsToPixels($pValue)
Convert points to pixels.
static imagecreatefrombmp($p_sFile)
Create a new image from file.
static pixelsToCellDimension($pValue, \PhpOffice\PhpSpreadsheet\Style\Font $pDefaultFont)
Convert pixels to column width.
static pixelsToPoints($pValue)
Convert pixels to points.
static $defaultColumnWidths
static EMUToPixels($pValue)
Convert EMU to pixels.
static pixelsToEMU($pValue)
Convert pixels to EMU.