Table of Contents

Class BackgroundSize

Namespace
iText.Layout.Properties
Assembly
itext.layout.dll

Class to hold background-size property.

public class BackgroundSize
Inheritance
BackgroundSize
Inherited Members

Constructors

BackgroundSize()

Creates a new BackgroundSize instance.

public BackgroundSize()

Remarks

Creates a new BackgroundSize instance. The "cover" and "contain" properties are not set.

Methods

GetBackgroundHeightSize()

Gets the background height property of the image.

public virtual UnitValue GetBackgroundHeightSize()

Returns

UnitValue

the UnitValue height for this image.

See Also
iText.Layout.Properties.BackgroundSize.backgroundHeightSize

GetBackgroundWidthSize()

Gets the background width property of the image.

public virtual UnitValue GetBackgroundWidthSize()

Returns

UnitValue

the UnitValue width for this image.

See Also
iText.Layout.Properties.BackgroundSize.backgroundWidthSize

IsContain()

Returns value of the "contain" property.

public virtual bool IsContain()

Returns

bool

true if property "contain" is set to the size, otherwise false.

See Also
iText.Layout.Properties.BackgroundSize.contain

IsCover()

Returns value of the "cover" property.

public virtual bool IsCover()

Returns

bool

true if property "cover" is set to the size, otherwise false.

See Also
iText.Layout.Properties.BackgroundSize.cover

IsSpecificSize()

Returns is size has specific property.

public virtual bool IsSpecificSize()

Returns

bool

true if size set to "contain" or "cover", otherwise false.

SetBackgroundSizeToContain()

Clears all size values and sets the "contain" property true.

public virtual void SetBackgroundSizeToContain()
See Also
iText.Layout.Properties.BackgroundSize.contain

SetBackgroundSizeToCover()

Clears all size values and sets the "cover" property true.

public virtual void SetBackgroundSizeToCover()
See Also
iText.Layout.Properties.BackgroundSize.cover

SetBackgroundSizeToValues(UnitValue, UnitValue)

Clears all current properties and sets new width and height values.

public virtual void SetBackgroundSizeToValues(UnitValue width, UnitValue height)

Parameters

width UnitValue

a UnitValue object

height UnitValue

a UnitValue object

Remarks

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.