Package com.itextpdf.layout.properties
Class BackgroundSize
java.lang.Object
com.itextpdf.layout.properties.BackgroundSize
Class to hold background-size property.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the background height property of the image.Gets the background width property of the image.boolean
Returns value of the "contain" property.boolean
isCover()
Returns value of the "cover" property.boolean
Returns is size has specific property.void
Clears all size values and sets the "contain" propertytrue
.void
Clears all size values and sets the "cover" propertytrue
.void
setBackgroundSizeToValues
(UnitValue width, UnitValue height) Clears all current properties and sets new width and height values.
-
Constructor Details
-
BackgroundSize
public BackgroundSize()Creates a newBackgroundSize
instance. 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:
-
contain
-
setBackgroundSizeToCover
public void setBackgroundSizeToCover()Clears all size values and sets the "cover" propertytrue
.- See Also:
-
cover
-
getBackgroundWidthSize
Gets the background width property of the image.- Returns:
-
the
UnitValue
width for this image. - See Also:
-
backgroundWidthSize
-
getBackgroundHeightSize
Gets the background height property of the image.- Returns:
-
the
UnitValue
height for this image. - See Also:
-
backgroundHeightSize
-
isSpecificSize
public boolean isSpecificSize()Returns is size has specific property.- Returns:
-
true
if size set to "contain" or "cover", otherwise false.
-
isContain
public boolean isContain()Returns value of the "contain" property.- Returns:
-
true
if property "contain" is set to the size, otherwise false. - See Also:
-
contain
-
isCover
public boolean isCover()Returns value of the "cover" property.- Returns:
-
true
if property "cover" is set to the size, otherwise false. - See Also:
-
cover
-