Package com.itextpdf.layout.renderer
Class BackgroundSizeCalculationUtil
java.lang.Object
com.itextpdf.layout.renderer.BackgroundSizeCalculationUtil
Utility class for calculate background image width and height.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
calculateBackgroundHeight
(UnitValue height, float areaHeight, boolean scale, BackgroundImage image, Float[] widthAndHeight) static float[]
calculateBackgroundImageSize
(BackgroundImage image, float areaWidth, float areaHeight) Calculates width and height values for image with a given area params.private static BackgroundSize
calculateBackgroundSizeForArea
(BackgroundImage image, float areaWidth, float areaHeight) private static void
calculateBackgroundWidth
(UnitValue width, float areaWidth, boolean scale, BackgroundImage image, Float[] widthAndHeight) private static BackgroundSize
createSizeWithMaxValueSide
(boolean maxWidth) private static void
scaleHeight
(float newHeight, BackgroundImage image, Float[] imageWidthAndHeight) private static void
scaleWidth
(float newWidth, BackgroundImage image, Float[] imageWidthAndHeight) private static void
setDefaultSizeIfNull
(Float[] widthAndHeight, float areaWidth, float areaHeight, BackgroundImage image, boolean isGradient)
-
Field Details
-
PERCENT_100
private static final int PERCENT_100- See Also:
-
PERCENT_VALUE_100
-
-
Constructor Details
-
BackgroundSizeCalculationUtil
private BackgroundSizeCalculationUtil()
-
-
Method Details
-
calculateBackgroundImageSize
public static float[] calculateBackgroundImageSize(BackgroundImage image, float areaWidth, float areaHeight) Calculates width and height values for image with a given area params.- Parameters:
image
- theBackgroundImage
width and height of which you want to calculateareaWidth
- width of the area of this imagesareaHeight
- height of the area of this images- Returns:
- array of two Float values. NOTE that first value defines width, second defines height.
- See Also:
-
calculateBackgroundSizeForArea
private static BackgroundSize calculateBackgroundSizeForArea(BackgroundImage image, float areaWidth, float areaHeight) -
createSizeWithMaxValueSide
-
calculateBackgroundWidth
private static void calculateBackgroundWidth(UnitValue width, float areaWidth, boolean scale, BackgroundImage image, Float[] widthAndHeight) -
calculateBackgroundHeight
private static void calculateBackgroundHeight(UnitValue height, float areaHeight, boolean scale, BackgroundImage image, Float[] widthAndHeight) -
scaleWidth
-
scaleHeight
private static void scaleHeight(float newHeight, BackgroundImage image, Float[] imageWidthAndHeight) -
setDefaultSizeIfNull
private static void setDefaultSizeIfNull(Float[] widthAndHeight, float areaWidth, float areaHeight, BackgroundImage image, boolean isGradient)
-