public static float getExcelCellAutoHeight( string strtest, float fontCountInline) { float defaultRowHeight = 18.00f; //每一行的高度指定 float defaultCount = 0.00f; for ( int i = 0; i <strtest.Length; i++) { float ff = getRegex(strtest.Substring(i, 1)); defaultCount = defaultCount + ff; } return (( int )(defaultCount / fontCountInline) + 1) * defaultRowHeight; //计算 } |
|
来自: caodaoquan > 《地法》