If you have an image that is larger than the paper size, you can split the image into smaller tiles.

Note

$image.split() supports only the JPG and PNG image formats.


$image.split($diagram.image, columns, rows)

Split an image into rows and columns. The returned array of the image contains chunks of images arranged from left-to-right and top-to-bottom.

 Name Type Description 
Parameter(s) image com.nomagic.magicreport.Image An image object. 
 column  int The number of columns. Specifies -1 to automate the calculated number of columns from the paper width. 
 rowint The number of rows. Specifies -1 to automate the calculated number of rows from the paper height.
Return java.util.List<com.nomagic.magicreport.Image> The array of the split image ordered from left-to-right and top-to-bottom.

 

For example, to split an image into 3x2 tiles, type the following lines:

#foreach ($d in $Diagram)
#foreach ($chunk in $image.split($d.image, 3, 2))
$chunk
#end
#end
Original Image vs. 3x2 Tiled ImageThe original image vs. 3x2 tiled image.

$image.split($diagram.image)

Split an image into rows and columns by automatically calculating the number of rows and columns based on the paper size. The returned array of the image contains divided images arranged from left-to-right and top-to-bottom.

 Name Type Description 
Parameter(s) image com.nomagic.magicreport.Image An image object. 
Return  java.util.List<com.nomagic.magicreport.Image>  The array of the split image ordered from left-to-right and top-to-bottom.