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
Colorthe background color
Background(Color, float)
Creates a background with a specified color and opacity.
public Background(Color color, float opacity)
Parameters
color
Colorthe background color
opacity
floatthe 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
Colorthe background color
extraLeft
floatextra coloring to the left side
extraTop
floatextra coloring at the top
extraRight
floatextra coloring to the right side
extraBottom
floatextra 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
Colorthe background color
opacity
floatthe opacity of the background color; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
extraLeft
floatextra coloring to the left side
extraTop
floatextra coloring at the top
extraRight
floatextra coloring to the right side
extraBottom
floatextra 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
Colorthe background color
opacity
floatthe opacity of the background color; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
clip
BackgroundBoxthe value to clip the background color
Fields
extraBottom
protected float extraBottom
Field Value
extraLeft
protected float extraLeft
Field Value
extraRight
protected float extraRight
Field Value
extraTop
protected float extraTop
Field Value
transparentColor
protected TransparentColor transparentColor
Field Value
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
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