C# Class AODL.Document.Helper.SizeConverter

The SizeConverter class offer different methods for size type conversation.
obsolete - don't start to use it, it will maybe deleted within an upcoming version
Show file Open project: monsterlabs/HumanRightsTracker

Public Properties

Property Type Description
intocm double
pxtocm double

Public Methods

Method Description
CmToInch ( double cm ) : double

Cms to inch.

CmToInchAsString ( double cm ) : string

Cms to inch as string.

CmToPixel ( double cm ) : double

Cms to pixel.

CmToPixelAsString ( double cm ) : string

Cms to pixel as string.

GetDoubleFromAnOfficeSizeValue ( string aSizeValue ) : double

Gets the double from an office size value.

There is no translation between cm or inch. You will just get the size you posted as double value.

GetHeightInCm ( int heightPixel, int dpiY ) : double

Cacluates the height in cm from height in pixel by using the vertical resolution.

GetHeightInPixel ( int height, int dpiY, bool cm ) : double

Cacluates the relative height in pixel from height in cm or inch by using the vertical resolution.

GetPixelFromAnOfficeSizeValue ( string aSizeValue ) : int

Gets the pixel from an office size value. e.g pass 1.54cm and get back 58

GetWidthInCm ( int widthPixel, int dpiX ) : double

Cacluates the width in cm from width in pixel by using the horizontal resolution.

GetWidthInPixel ( int width, int dpiX, bool cm ) : double

Cacluates the width in pixel from width in cm or inch by using the horizontal resolution.

InchToCm ( double inch ) : double

Inches to cm.

InchToCmAsString ( double inch ) : string

Inches to cm as string.

InchToPixel ( double inch ) : double

Inches to pixel.

InchToPixelAsString ( double inch ) : string

Inches to pixel as string.

IsCm ( string value ) : bool

Determines whether the specified value is in cm.

IsInch ( string value ) : bool

Determines whether the specified value is in inch.

MmToPixel ( double mm ) : double

Cms to pixel.

SizeConverter ( ) : System

Initializes a new instance of the SizeConverter class.

Method Details

CmToInch() public static method

Cms to inch.
public static CmToInch ( double cm ) : double
cm double The cm.
return double

CmToInchAsString() public static method

Cms to inch as string.
public static CmToInchAsString ( double cm ) : string
cm double The cm.
return string

CmToPixel() public static method

Cms to pixel.
public static CmToPixel ( double cm ) : double
cm double The cm.
return double

CmToPixelAsString() public static method

Cms to pixel as string.
public static CmToPixelAsString ( double cm ) : string
cm double The cm.
return string

GetDoubleFromAnOfficeSizeValue() public static method

Gets the double from an office size value.
There is no translation between cm or inch. You will just get the size you posted as double value.
public static GetDoubleFromAnOfficeSizeValue ( string aSizeValue ) : double
aSizeValue string A size value.
return double

GetHeightInCm() public static method

Cacluates the height in cm from height in pixel by using the vertical resolution.
public static GetHeightInCm ( int heightPixel, int dpiY ) : double
heightPixel int The height.
dpiY int The dpi Y.
return double

GetHeightInPixel() public static method

Cacluates the relative height in pixel from height in cm or inch by using the vertical resolution.
public static GetHeightInPixel ( int height, int dpiY, bool cm ) : double
height int The height.
dpiY int The dpi vertical.
cm bool if set to true in cm otherwise inch.
return double

GetPixelFromAnOfficeSizeValue() public static method

Gets the pixel from an office size value. e.g pass 1.54cm and get back 58
public static GetPixelFromAnOfficeSizeValue ( string aSizeValue ) : int
aSizeValue string A size value.
return int

GetWidthInCm() public static method

Cacluates the width in cm from width in pixel by using the horizontal resolution.
public static GetWidthInCm ( int widthPixel, int dpiX ) : double
widthPixel int The width.
dpiX int The dpi X.
return double

GetWidthInPixel() public static method

Cacluates the width in pixel from width in cm or inch by using the horizontal resolution.
public static GetWidthInPixel ( int width, int dpiX, bool cm ) : double
width int The width.
dpiX int The dpi X.
cm bool if set to true in cm otherwise inch.
return double

InchToCm() public static method

Inches to cm.
public static InchToCm ( double inch ) : double
inch double The inch.
return double

InchToCmAsString() public static method

Inches to cm as string.
public static InchToCmAsString ( double inch ) : string
inch double The inch.
return string

InchToPixel() public static method

Inches to pixel.
public static InchToPixel ( double inch ) : double
inch double The inch.
return double

InchToPixelAsString() public static method

Inches to pixel as string.
public static InchToPixelAsString ( double inch ) : string
inch double The inch.
return string

IsCm() public static method

Determines whether the specified value is in cm.
public static IsCm ( string value ) : bool
value string The value.
return bool

IsInch() public static method

Determines whether the specified value is in inch.
public static IsInch ( string value ) : bool
value string The value.
return bool

MmToPixel() public static method

Cms to pixel.
public static MmToPixel ( double mm ) : double
mm double
return double

SizeConverter() public method

Initializes a new instance of the SizeConverter class.
public SizeConverter ( ) : System
return System

Property Details

intocm public static property

Inch to cm factor
public static double intocm
return double

pxtocm public static property

Pixel to cm factor
public static double pxtocm
return double