Table of Contents

Class Background

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

A specialized class holding configurable properties related to an IElement 's background.

public class Background
Inheritance
Background
Inherited Members

Remarks

A specialized class holding configurable properties related to an IElement 's background. This class is meant to be used as the value for the BACKGROUND key in an IPropertyContainer . Allows to define a background color, and positive or negative changes to the location of the edges of the background coloring.

Constructors

Background(Color)

Creates a background with a specified color.

public Background(Color color)

Parameters

color Color

the background color

Background(Color, float)

Creates a background with a specified color and opacity.

public Background(Color color, float opacity)

Parameters

color Color

the background color

opacity float

the opacity of the background color; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent

Background(Color, float, float, float, float)

Creates a background with a specified color, and extra space that must be counted as part of the background and therefore colored.

public Background(Color color, float extraLeft, float extraTop, float extraRight, float extraBottom)

Parameters

color Color

the background color

extraLeft float

extra coloring to the left side

extraTop float

extra coloring at the top

extraRight float

extra coloring to the right side

extraBottom float

extra coloring at the bottom

Remarks

Creates a background with a specified color, and extra space that must be counted as part of the background and therefore colored. These values are allowed to be negative.

Background(Color, float, float, float, float, float)

Creates a background with a specified color, and extra space that must be counted as part of the background and therefore colored.

public Background(Color color, float opacity, float extraLeft, float extraTop, float extraRight, float extraBottom)

Parameters

color Color

the background color

opacity float

the opacity of the background color; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent

extraLeft float

extra coloring to the left side

extraTop float

extra coloring at the top

extraRight float

extra coloring to the right side

extraBottom float

extra coloring at the bottom

Remarks

Creates a background with a specified color, and extra space that must be counted as part of the background and therefore colored. These values are allowed to be negative.

Background(Color, float, BackgroundBox)

Creates a background with a specified color, opacity and clip value.

public Background(Color color, float opacity, BackgroundBox clip)

Parameters

color Color

the background color

opacity float

the opacity of the background color; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent

clip BackgroundBox

the value to clip the background color

Fields

extraBottom

protected float extraBottom

Field Value

float

extraLeft

protected float extraLeft

Field Value

float

extraRight

protected float extraRight

Field Value

float

extraTop

protected float extraTop

Field Value

float

transparentColor

protected TransparentColor transparentColor

Field Value

TransparentColor

Methods

GetBackgroundClip()

Gets background clip value.

public virtual BackgroundBox GetBackgroundClip()

Returns

BackgroundBox

background clip value

GetColor()

Gets the background's color.

public virtual Color GetColor()

Returns

Color

a Color of any supported kind

GetExtraBottom()

Gets the extra space that must be filled at the bottom of the Element.

public virtual float GetExtraBottom()

Returns

float

a float value

GetExtraLeft()

Gets the extra space that must be filled to the left of the Element.

public virtual float GetExtraLeft()

Returns

float

a float value

GetExtraRight()

Gets the extra space that must be filled to the right of the Element.

public virtual float GetExtraRight()

Returns

float

a float value

GetExtraTop()

Gets the extra space that must be filled at the top of the Element.

public virtual float GetExtraTop()

Returns

float

a float value

GetOpacity()

Gets the opacity of the background.

public virtual float GetOpacity()

Returns

float

a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent