리포트 수정 등 0816 요청사항 반영
This commit is contained in:
@@ -33,7 +33,15 @@ namespace friction
|
||||
//double columnWidthInTwips = (double)(pixels * (1440f / 96f));
|
||||
|
||||
return Convert.ToInt32(pixels);
|
||||
}
|
||||
|
||||
public static int Column2Pixel(ExcelWorksheet ws, int iColumn)
|
||||
{
|
||||
double dX = 0;
|
||||
for (int i = 1; i < iColumn; i++)
|
||||
dX += ColumnWidth2Pixel(ws, ws.Column(i).Width);
|
||||
|
||||
return (int)dX;
|
||||
}
|
||||
|
||||
public static double Pixel2ColumnWidth(ExcelWorksheet ws, int pixels)
|
||||
@@ -55,6 +63,14 @@ namespace friction
|
||||
return Convert.ToDouble(excelColumnWidth);
|
||||
}
|
||||
|
||||
public static int Pixel2NextColumn(ExcelWorksheet ws, int iCol, int iPixels)
|
||||
{
|
||||
while (iPixels > 0)
|
||||
iPixels -= ColumnWidth2Pixel(ws, ws.Column(iCol++).Width);
|
||||
|
||||
return iCol;
|
||||
}
|
||||
|
||||
public static int RowHeight2Pixel(double excelRowHeight)
|
||||
{
|
||||
//convert height to pixel
|
||||
@@ -63,6 +79,15 @@ namespace friction
|
||||
return Convert.ToInt32(pixels);
|
||||
}
|
||||
|
||||
public static int Row2Pixel(ExcelWorksheet ws, int iRow)
|
||||
{
|
||||
int iY = 0;
|
||||
for (int i = 1; i < iRow; i++)
|
||||
iY += RowHeight2Pixel(ws.Row(i).Height);
|
||||
|
||||
return iY;
|
||||
}
|
||||
|
||||
public static double Pixel2RowHeight(int pixels)
|
||||
{
|
||||
//convert height to pixel
|
||||
@@ -71,6 +96,15 @@ namespace friction
|
||||
return excelRowHeight;
|
||||
}
|
||||
|
||||
public static int Pixel2NextRow(ExcelWorksheet ws, int iRow, int iPixels)
|
||||
{
|
||||
double dPixels = iPixels;
|
||||
while(dPixels > 0)
|
||||
dPixels -= RowHeight2Pixel(ws.Row(iRow++).Height);
|
||||
|
||||
return iRow;
|
||||
}
|
||||
|
||||
public static int MTU2Pixel(int mtus)
|
||||
{
|
||||
//convert MTU to pixel
|
||||
|
||||
Reference in New Issue
Block a user