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
Afficher le fichier Open project: monsterlabs/HumanRightsTracker

Méthodes publiques

Свойство Type Description
intocm double
pxtocm double

Méthodes publiques

Méthode 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 méthode

Cms to inch.
public static CmToInch ( double cm ) : double
cm double The cm.
Résultat double

CmToInchAsString() public static méthode

Cms to inch as string.
public static CmToInchAsString ( double cm ) : string
cm double The cm.
Résultat string

CmToPixel() public static méthode

Cms to pixel.
public static CmToPixel ( double cm ) : double
cm double The cm.
Résultat double

CmToPixelAsString() public static méthode

Cms to pixel as string.
public static CmToPixelAsString ( double cm ) : string
cm double The cm.
Résultat string

GetDoubleFromAnOfficeSizeValue() public static méthode

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.
Résultat double

GetHeightInCm() public static méthode

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.
Résultat double

GetHeightInPixel() public static méthode

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.
Résultat double

GetPixelFromAnOfficeSizeValue() public static méthode

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.
Résultat int

GetWidthInCm() public static méthode

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.
Résultat double

GetWidthInPixel() public static méthode

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.
Résultat double

InchToCm() public static méthode

Inches to cm.
public static InchToCm ( double inch ) : double
inch double The inch.
Résultat double

InchToCmAsString() public static méthode

Inches to cm as string.
public static InchToCmAsString ( double inch ) : string
inch double The inch.
Résultat string

InchToPixel() public static méthode

Inches to pixel.
public static InchToPixel ( double inch ) : double
inch double The inch.
Résultat double

InchToPixelAsString() public static méthode

Inches to pixel as string.
public static InchToPixelAsString ( double inch ) : string
inch double The inch.
Résultat string

IsCm() public static méthode

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

IsInch() public static méthode

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

MmToPixel() public static méthode

Cms to pixel.
public static MmToPixel ( double mm ) : double
mm double
Résultat double

SizeConverter() public méthode

Initializes a new instance of the SizeConverter class.
public SizeConverter ( ) : System
Résultat System

Property Details

intocm public_oe static_oe property

Inch to cm factor
public static double intocm
Résultat double

pxtocm public_oe static_oe property

Pixel to cm factor
public static double pxtocm
Résultat double