You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

These functions are for limiting image size by scaling an image when its size overlaps the paper margin.


$image.limitImageSize(image)
Return image that is scaled to fit paper page (like "Fit image to paper" option)

 NameTypeDescription
Parameter(s)imagecom.nomagic.magicreport.ImageAn image object for the element.
Return-com.nomagic.magicreport.ImageA resized image.

For example:

#foreach($d in $Diagram)
$image.limitImageSize($d.image)
#end


$image.limitImageSize(image, maximumWidth, maximumHeight)

Return image that is scaled to fit paper page but not bigger than specific maximumWidth and maximumHeight in a term of measurement (px, in, cm, mm, pt)

 NameTypeDescription
Parameter(s)imagecom.nomagic.magicreport.ImageAn image object for the element.
 maximumWidthjava.lang.StringMaximum width of resized image in a term of measurement.
 maximumHeightjava.lang.StringMaximum height of resized image in a term of measurement.
Return-com.nomagic.magicreport.ImageA resized image.

For example:

#foreach($d in $Diagram)
$image.limitImageSize($d.image, "5in", "8in")
#end

#foreach($d in $Diagram)
$image.limitImageSize($d.image, "-1", "8in")
#end

#foreach($d in $Diagram)
$image.limitImageSize($d.image, "5in", "-1")
#end

Note

If you do not want to specify the value in the parameter, use -1 instead.



$image.limitImageSize(image, maximumWidthPixel, maximumHeightPixel)
Return image that is scaled to fit paper page but not bigger than specific maximumWidth and maximumHeight in a term of pixel

 NameTypeDescription
Parameter(s)imagecom.nomagic.magicreport.ImageAn image object for the element.
 maximumWidthPixelintMaximum width of resized image in a term of measurement.
 maximumHeightPixelintMaximum height of resized image in a term of measurement.
Return-com.nomagic.magicreport.ImageA resized image.

For example:

#foreach($d in $Diagram)
$image.limitImageSize($d.image, 480, 680)
#end

#foreach($d in $Diagram)
$image.limitImageSize($d.image, -1, 680)
#end

#foreach($d in $Diagram)
$image.limitImageSize($d.image, 480, -1)
#end

Note

If you do not want to specify the value in the parameter, use -1 instead.