ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Protected Attributes | Properties | List of all members
ImageResizer.Resizing.BoxPadding Class Reference

Represents the widths of edges of a box. More...

Public Member Functions

 BoxPadding (double all)
 Create a box with all edges the same width. More...
 
 BoxPadding (double left, double top, double right, double bottom)
 Create a box, specifying individual widths for each size More...
 
 BoxPadding (BoxPadding original)
 Copies the specified BoxPadding instance More...
 
BoxPadding SetAll (double all)
 Sets the width of all edges, returning a new instance More...
 
BoxPadding SetTop (double top)
 
BoxPadding SetLeft (double left)
 
BoxPadding SetRight (double right)
 
BoxPadding SetBottom (double bottom)
 
float[] GetEdgeOffsets ()
 Gets edge offsets as a clockwise array, starting with Top. More...
 
override string ToString ()
 

Static Public Member Functions

static BoxPadding Parse (string text, BoxPadding fallbackValue)
 

Protected Attributes

double top = 0
 

Properties

double Top [get]
 
double Left [get]
 
double Right [get]
 
double Bottom [get]
 
double All [get]
 Returns double.NaN unless all edges are the same width, in which case that width is returned More...
 
double all [get, set]
 
static BoxPadding Empty [get]
 Returns an instance with a width of 0 More...
 
bool IsEmpty [get]
 Returns true if th More...
 

Detailed Description

Represents the widths of edges of a box.

Definition at line 12 of file BoxPadding.cs.

Constructor & Destructor Documentation

ImageResizer.Resizing.BoxPadding.BoxPadding ( double  all)
inline

Create a box with all edges the same width.

Parameters
all

Definition at line 28 of file BoxPadding.cs.

28  {
29  this.all = all;
30  }
ImageResizer.Resizing.BoxPadding.BoxPadding ( double  left,
double  top,
double  right,
double  bottom 
)
inline

Create a box, specifying individual widths for each size

Parameters
left
top
right
bottom

Definition at line 38 of file BoxPadding.cs.

38  {
39  this.top = top; this.left = left; this.bottom = bottom; this.right = right;
40  }
ImageResizer.Resizing.BoxPadding.BoxPadding ( BoxPadding  original)
inline

Copies the specified BoxPadding instance

Parameters
original

Definition at line 45 of file BoxPadding.cs.

45  {
46  this.top = original.top;
47  this.bottom = original.bottom;
48  this.right = original.right;
49  this.left = original.left;
50  }

Member Function Documentation

float [] ImageResizer.Resizing.BoxPadding.GetEdgeOffsets ( )
inline

Gets edge offsets as a clockwise array, starting with Top.

Returns

Definition at line 111 of file BoxPadding.cs.

Referenced by ImageResizer.Resizing.LayoutBuilder.AddRing().

111  {
112  return new float[4] { (float)top, (float)right, (float)bottom, (float)left };
113  }
BoxPadding ImageResizer.Resizing.BoxPadding.SetAll ( double  all)
inline

Sets the width of all edges, returning a new instance

Parameters
all
Returns

Definition at line 64 of file BoxPadding.cs.

64  {
65  BoxPadding b = new BoxPadding(this); b.all = all;
66  return b;
67  }
BoxPadding(double all)
Create a box with all edges the same width.
Definition: BoxPadding.cs:28

Property Documentation

double ImageResizer.Resizing.BoxPadding.All
get

Returns double.NaN unless all edges are the same width, in which case that width is returned

Definition at line 88 of file BoxPadding.cs.

Referenced by ImageResizer.Plugins.FreeImageBuilder.FreeImageBuilderPlugin.buildFiBitmap(), and ImageResizer.ImageBuilder.RenderBorder().

BoxPadding ImageResizer.Resizing.BoxPadding.Empty
staticget

Returns an instance with a width of 0

Definition at line 102 of file BoxPadding.cs.

bool ImageResizer.Resizing.BoxPadding.IsEmpty
get

The documentation for this class was generated from the following file: