iText 8.0.5 API
iText.Layout.Properties.BackgroundRepeat Class Reference

Class to hold background-repeat property. More...

Public Types

enum   BackgroundRepeatValue { BackgroundRepeatValue.NO_REPEAT, BackgroundRepeatValue.REPEAT, BackgroundRepeatValue.ROUND, BackgroundRepeatValue.SPACE }
  Defines all possible background repeat values for one axis. More...
 

Public Member Functions

  BackgroundRepeat ()
  Creates a new BackgroundRepeat instance. More...
 
  BackgroundRepeat (BackgroundRepeat.BackgroundRepeatValue repeat)
  Creates a new BackgroundRepeat instance based on one BackgroundRepeat instance. More...
 
  BackgroundRepeat (BackgroundRepeat.BackgroundRepeatValue xAxisRepeat, BackgroundRepeat.BackgroundRepeatValue yAxisRepeat)
  Creates a new BackgroundRepeat instance based on two BackgroundRepeat instance. More...
 
virtual BackgroundRepeat.BackgroundRepeatValue  GetXAxisRepeat ()
  Gets the BackgroundRepeatValue value for X axis. More...
 
virtual BackgroundRepeat.BackgroundRepeatValue  GetYAxisRepeat ()
  Gets the BackgroundRepeatValue value for Y axis. More...
 
virtual bool  IsNoRepeatOnXAxis ()
  Checks whether the BackgroundRepeatValue.NO_REPEAT value is set on X axis or not. More...
 
virtual bool  IsNoRepeatOnYAxis ()
  Checks whether the BackgroundRepeatValue.NO_REPEAT value is set on Y axis or not. More...
 
virtual Point  PrepareRectangleToDrawingAndGetWhitespace (Rectangle imageRectangle, Rectangle backgroundArea, BackgroundSize backgroundSize)
  Prepares the image rectangle for drawing. More...
 

Detailed Description

Class to hold background-repeat property.

Member Enumeration Documentation

◆ BackgroundRepeatValue

Defines all possible background repeat values for one axis.

Enumerator
NO_REPEAT 

The no repeat value which mean that the background will not be repeated, but displayed once with its original size.

REPEAT 

The repeat value which means that the background with its original size will be repeated over the entire available space.

ROUND 

The round value which mean that the background will stretch or compress.

The round value which mean that the background will stretch or compress. Initially, the available space is divided by module by the size of the background, if the result is less than half the size of the background, then the background is stretched in such a way that when it is repeated it will take up all the space, otherwise the background is compressed to fit one more background in the available space.

SPACE 

The space value which means that the background will be repeated as much as possible with its original size and without cropping.

The space value which means that the background will be repeated as much as possible with its original size and without cropping. the first and last backgrounds are attached to opposite edges of the available space, and the whitespaces are evenly distributed between the backgrounds.

Constructor & Destructor Documentation

◆ BackgroundRepeat() [1/3]

iText.Layout.Properties.BackgroundRepeat.BackgroundRepeat ( )
inline

Creates a new BackgroundRepeat instance.

Creates a new BackgroundRepeat instance. The axis will have the value BackgroundRepeatValue.REPEAT.

◆ BackgroundRepeat() [2/3]

iText.Layout.Properties.BackgroundRepeat.BackgroundRepeat ( BackgroundRepeat.BackgroundRepeatValue  repeat )
inline

Creates a new BackgroundRepeat instance based on one BackgroundRepeat instance.

Parameters
repeat the repeat value that will be set for for both axes

◆ BackgroundRepeat() [3/3]

iText.Layout.Properties.BackgroundRepeat.BackgroundRepeat ( BackgroundRepeat.BackgroundRepeatValue  xAxisRepeat,
BackgroundRepeat.BackgroundRepeatValue  yAxisRepeat 
)
inline

Creates a new BackgroundRepeat instance based on two BackgroundRepeat instance.

Parameters
xAxisRepeat the repeat value that will be set for for X axis
yAxisRepeat the repeat value that will be set for for Y axis

Member Function Documentation

◆ GetXAxisRepeat()

virtual BackgroundRepeat.BackgroundRepeatValue iText.Layout.Properties.BackgroundRepeat.GetXAxisRepeat ( )
inlinevirtual

Gets the BackgroundRepeatValue value for X axis.

Returns
the repeat value for X axis.

◆ GetYAxisRepeat()

virtual BackgroundRepeat.BackgroundRepeatValue iText.Layout.Properties.BackgroundRepeat.GetYAxisRepeat ( )
inlinevirtual

Gets the BackgroundRepeatValue value for Y axis.

Returns
the repeat value for Y axis.

◆ IsNoRepeatOnXAxis()

virtual bool iText.Layout.Properties.BackgroundRepeat.IsNoRepeatOnXAxis ( )
inlinevirtual

Checks whether the BackgroundRepeatValue.NO_REPEAT value is set on X axis or not.

Returns
is the X axis have BackgroundRepeatValue.NO_REPEAT value

◆ IsNoRepeatOnYAxis()

virtual bool iText.Layout.Properties.BackgroundRepeat.IsNoRepeatOnYAxis ( )
inlinevirtual

Checks whether the BackgroundRepeatValue.NO_REPEAT value is set on Y axis or not.

Returns
is the Y axis have BackgroundRepeatValue.NO_REPEAT value

◆ PrepareRectangleToDrawingAndGetWhitespace()

virtual Point iText.Layout.Properties.BackgroundRepeat.PrepareRectangleToDrawingAndGetWhitespace ( Rectangle  imageRectangle,
Rectangle  backgroundArea,
BackgroundSize  backgroundSize 
)
inlinevirtual

Prepares the image rectangle for drawing.

Prepares the image rectangle for drawing. This means that the size and position of the image rectangle will be changed to match the BackgroundRepeatValue values for the axes.

Parameters
imageRectangle the image rectangle which will be changed
backgroundArea the background available area
backgroundSize the image background size property
Returns
the necessary whitespace between backgrounds