Class BackgroundSize
java.lang.Object
com.itextpdf.layout.properties.BackgroundSize
Class to hold background-size property.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidclear()Gets the background height property of the image.Gets the background width property of the image.booleanReturns value of the "contain" property.booleanisCover()Returns value of the "cover" property.booleanReturns is size has specific property.voidClears all size values and sets the "contain" propertytrue.voidClears all size values and sets the "cover" propertytrue.voidsetBackgroundSizeToValues(UnitValue width, UnitValue height) Clears all current properties and sets new width and height values.
-
Field Details
-
backgroundWidthSize
-
backgroundHeightSize
-
cover
private boolean coverImage covers the entire area and its size may be more than the area. -
contain
private boolean containImage hsd a maximum size but not larger than the area.
-
-
Constructor Details
-
BackgroundSize
public BackgroundSize()Creates a newBackgroundSizeinstance. The "cover" and "contain" properties are not set.
-
-
Method Details
-
setBackgroundSizeToValues
Clears all current properties and sets new width and height values. One of the parameters can be null. Note that in this case null property will be scaled so that it becomes proportionally equal with the non-null value. If both parameters are set to null, then the default image size will be used. -
setBackgroundSizeToContain
public void setBackgroundSizeToContain()Clears all size values and sets the "contain" propertytrue.- See Also:
-
setBackgroundSizeToCover
public void setBackgroundSizeToCover()Clears all size values and sets the "cover" propertytrue.- See Also:
-
getBackgroundWidthSize
-
getBackgroundHeightSize
-
isSpecificSize
public boolean isSpecificSize()Returns is size has specific property.- Returns:
trueif size set to "contain" or "cover", otherwise false.
-
isContain
public boolean isContain()Returns value of the "contain" property.- Returns:
trueif property "contain" is set to the size, otherwise false.- See Also:
-
isCover
public boolean isCover()Returns value of the "cover" property.- Returns:
trueif property "cover" is set to the size, otherwise false.- See Also:
-
clear
private void clear()
-