C# 클래스 LayoutFarm.HtmlBoxes.CssValueParser

Parse CSS properties values like numbers, urls, etc.
파일 보기 프로젝트 열기: prepare/HTML-Renderer 1 사용 예제들

공개 메소드들

메소드 설명
ConvertToPx ( CssLength length, float hundredPercent, CssBox box ) : float

get length in pixel

ConvertToPxWithFontAdjust ( CssLength length, float hundredPercent, CssBox box ) : float
GetActualBorderWidth ( CssLength borderValue, CssBox b ) : float
GetActualColor ( string colorValue ) : Color

Parses a color value in CSS style; e.g. #ff0000, red, rgb(255,0,0), rgb(100%, 0, 0)

비공개 메소드들

메소드 설명
GetColorByHex ( string str, int idx, int length, Color &color ) : bool

Get color by parsing given hex value color string (#A28B34).

GetColorByName ( string str, int idx, int length, Color &color ) : bool

Get color by given name, including .NET name.

GetColorByRgb ( string str, int idx, int length, Color &color ) : bool

Get color by parsing given RGB value color string (RGB(255,180,90))

GetColorByRgba ( string str, int idx, int length, Color &color ) : bool

Get color by parsing given RGBA value color string (RGBA(255,180,90,180))

ParseHexInt ( string str, int idx, int length ) : int

Parse the given hex number string to positive int value. Assume given substring is not empty and all indexes are valid!

ParseInt ( string str, int idx, int length ) : int

Parse the given decimal number string to positive int value. Assume given substring is not empty and all indexes are valid!

ParseIntAtIndex ( string str, int &startIdx ) : int

Parse the given decimal number string to positive int value.
Start at given startIdx, ignore whitespaces and take as many digits as possible to parse to int.

SubStringEquals ( string str, int idx, int length, string str2 ) : bool

Compare that the substring of str is equal to str Assume given substring is not empty and all indexes are valid!

TryGetColor ( string str, int idx, int length, Color &color ) : bool

Parses a color value in CSS style; e.g. #ff0000, RED, RGB(255,0,0), RGB(100%, 0, 0)

메소드 상세

ConvertToPx() 공개 정적인 메소드

get length in pixel
public static ConvertToPx ( CssLength length, float hundredPercent, CssBox box ) : float
length LayoutFarm.Css.CssLength
hundredPercent float
box CssBox
리턴 float

ConvertToPxWithFontAdjust() 공개 정적인 메소드

public static ConvertToPxWithFontAdjust ( CssLength length, float hundredPercent, CssBox box ) : float
length LayoutFarm.Css.CssLength
hundredPercent float
box CssBox
리턴 float

GetActualBorderWidth() 공개 정적인 메소드

public static GetActualBorderWidth ( CssLength borderValue, CssBox b ) : float
borderValue LayoutFarm.Css.CssLength
b CssBox
리턴 float

GetActualColor() 공개 정적인 메소드

Parses a color value in CSS style; e.g. #ff0000, red, rgb(255,0,0), rgb(100%, 0, 0)
public static GetActualColor ( string colorValue ) : Color
colorValue string color string value to parse
리턴 Color