ILIAS
eassessment Revision 61809
|
Static Public Member Functions | |
static | sizeCol ($sheet, $col= 'A') |
Get the width of a column in pixels. | |
static | sizeRow ($sheet, $row=1) |
Convert the height of a cell from user's units to pixels. | |
static | getDistanceX (PHPExcel_Worksheet $sheet, $startColumn= 'A', $startOffsetX=0, $endColumn= 'A', $endOffsetX=0) |
Get the horizontal distance in pixels between two anchors The distanceX is found as sum of all the spanning columns widths minus correction for the two offsets. | |
static | getDistanceY (PHPExcel_Worksheet $sheet, $startRow=1, $startOffsetY=0, $endRow=1, $endOffsetY=0) |
Get the vertical distance in pixels between two anchors The distanceY is found as sum of all the spanning rows minus two offsets. | |
static | oneAnchor2twoAnchor ($sheet, $coordinates, $offsetX, $offsetY, $width, $height) |
Convert 1-cell anchor coordinates to 2-cell anchor coordinates This function is ported from PEAR Spreadsheet_Writer_Excel with small modifications. |
Definition at line 35 of file Excel5.php.
|
static |
Get the horizontal distance in pixels between two anchors The distanceX is found as sum of all the spanning columns widths minus correction for the two offsets.
PHPExcel_Worksheet | $sheet | |
string | $startColumn | |
integer | $startOffset | Offset within start cell measured in 1/1024 of the cell width |
string | $endColumn | |
integer | $endOffset | Offset within end cell measured in 1/1024 of the cell width |
Definition at line 144 of file Excel5.php.
References PHPExcel_Cell\columnIndexFromString(), sizeCol(), and PHPExcel_Cell\stringFromColumnIndex().
Referenced by PHPExcel_Reader_Excel5\load().
|
static |
Get the vertical distance in pixels between two anchors The distanceY is found as sum of all the spanning rows minus two offsets.
PHPExcel_Worksheet | $sheet | |
string | $startRow | (1-based) |
integer | $startOffset | Offset within start cell measured in 1/256 of the cell height |
string | $endRow | (1-based) |
integer | $endOffset | Offset within end cell measured in 1/256 of the cell height |
Definition at line 175 of file Excel5.php.
References $row, and sizeRow().
Referenced by PHPExcel_Reader_Excel5\load().
|
static |
Convert 1-cell anchor coordinates to 2-cell anchor coordinates This function is ported from PEAR Spreadsheet_Writer_Excel with small modifications.
Calculate the vertices that define the position of the image as required by the OBJ record.
+------------+------------+ | A | B |
+--—+---------—+---------—+ | |(x1,y1) | | | 1 |(A1)._______|______ | | | | | | | | | | | +--—+-—| BITMAP |--—+ | | | | | | 2 | |______________. | | | | (B2)| | | | (x2,y2)| +-— +---------—+---------—+
Example of a bitmap that covers some of the area from cell A1 to cell B2.
Based on the width and height of the bitmap we need to calculate 8 vars: $col_start, $row_start, $col_end, $row_end, $x1, $y1, $x2, $y2. The width and height of the cells are also variable and have to be taken into account. The values of $col_start and $row_start are passed in from the calling function. The values of $col_end and $row_end are calculated by subtracting the width and height of the bitmap from the width and height of the underlying cells. The vertices are expressed as a percentage of the underlying cell width as follows (rhs values are in pixels):
x1 = X / W *1024 y1 = Y / H *256 x2 = (X-1) / W *1024 y2 = (Y-1) / H *256 Where: X is distance from the left side of the underlying cell Y is distance from the top of the underlying cell W is the width of the cell H is the height of the cell
PHPExcel_Worksheet | $sheet | |
string | $coordinates | E.g. 'A1' |
integer | $offsetX | Horizontal offset in pixels |
integer | $offsetY | Vertical offset in pixels |
integer | $width | Width in pixels |
integer | $height | Height in pixels |
Definition at line 245 of file Excel5.php.
References $row, PHPExcel_Cell\columnIndexFromString(), PHPExcel_Cell\coordinateFromString(), sizeCol(), sizeRow(), and PHPExcel_Cell\stringFromColumnIndex().
Referenced by PHPExcel_Writer_Excel5\_buildWorksheetEschers().
|
static |
Get the width of a column in pixels.
We use the relationship y = ceil(7x) where x is the width in intrinsic Excel units (measuring width in number of normal characters) This holds for Arial 10
PHPExcel_Worksheet | $sheet | The sheet |
integer | $col | The column |
Definition at line 46 of file Excel5.php.
References PHPExcel_Shared_Drawing\cellDimensionToPixels(), and PHPExcel_Shared_Font\getDefaultColumnWidthByFont().
Referenced by PHPExcel_Writer_Excel5_Worksheet\_positionImage(), getDistanceX(), PHPExcel_Reader_Excel5\load(), and oneAnchor2twoAnchor().
|
static |
Convert the height of a cell from user's units to pixels.
By interpolation the relationship is: y = 4/3x. If the height hasn't been set by the user we use the default value. If the row is hidden we use a value of zero.
PHPExcel_Worksheet | $sheet | The sheet |
integer | $row | The row index (1-based) |
Definition at line 93 of file Excel5.php.
References $row, PHPExcel_Shared_Font\fontSizeToPixels(), PHPExcel_Shared_Font\getDefaultRowHeightByFont(), and PHPExcel_Shared_Drawing\pointsToPixels().
Referenced by PHPExcel_Writer_Excel5_Worksheet\_positionImage(), getDistanceY(), PHPExcel_Reader_Excel5\load(), and oneAnchor2twoAnchor().