Xojo Conferences
MBSOct2019CologneDE
XDCMarch2020NashvilleUS

DynaPDF Manual - Page 98

Previous Page 97   Index   Next Page 99

Table Functions
Page 98 of 770
SetCellImage
Syntax:
LBOOL tblSetCellImage(
const ITBL* Table, // Table pointer
SI32 Row,
// Row index or -1
SI32 Col,
// Column index or -1
LBOOL ForeGround,
// If true, the cell will be expanded if necessary
TCellAlign HAlign, // Horizontal alignment
TCellAlign VAlign, // Vertical alignment
float Width,
// Must be greater or equal zero
float Height,
// Must be greater or equal zero
const char* Image, // This should be an absolute path
UI32 Index)
// Image index (TIFF images only)
The function inserts an image horizontally and vertically aligned as specified. The image will be
loaded when the table is drawn. Therefore, it is recommended to use absolute paths so that the
image can still be loaded if the working directory was changed.
If the image is inserted as a background object, then it will be clipped if it does not fit into the cell
boundary. A cell can contain a background and a foreground object.
An image can also be added to the table as background object.
Foreground objects have a strong width and height. That means the cell will be expanded if
necessary.
Image formats which support no transparency are inserted opaque. Transparent GIF images are
inserted transparent and alpha channels in images will be considered. Images should normally be
inserted in the native image color space. To achieve this, set the flag tfUseImageCS with SetFlags().
Images can be scaled into the cell as follows:
Width = 0 and Height = 0 -> The image is scaled to the cell width or height depending on the
cell orientation. The aspect ratio will be preserved. If the flag tfScaleToRect is set, the image is
scaled so that both sides fit into the cell width and height. The row height must be greater
zero to achieve a meaningful result.
Width > 0 and Height = 0 or Width = 0 and Height > 0 -> The image is scaled to the given width
or height. The aspect ratio will be preserved. If the flag tfScaleToRect is set, the image is
scaled so that both sides fit into the given width or height and into cell width or height
depending on which side is missing. If the parameter Height and the row height are zero then
the flag tfScaleToRect has no effect.
Width > 0 and Height > 0 -> The image is scaled to the given width and height. The aspect ratio
is not preserved. If the flag tfScaleToRect is set, the image is scaled so that both sides fit into
the given width and height and the aspect ratio is preserved.
The parameters Width and Height are not exchanged if the cell uses a landscape orientation.
 

Previous topic: SetCellAction

Next topic: SetCellImageEx