pache POI 是用Java编写的免费开源的跨平台的 Java API,Apache POI提供API给Java程式对Microsoft Office格式档案读和写的功能。
HSSFClientAnchor用于创建一个新的端锚,并设置锚的左下和右下坐标,用于图片插入,画线等操作。
public HSSFClientAnchor(int dx1, int dy1, int dx2, int dy2, short col1, int row1, short col2, int row2) {
super(dx1, dy1, dx2, dy2);
this.checkRange(dx1, 0, 1023, "dx1");
this.checkRange(dx2, 0, 1023, "dx2");
this.checkRange(dy1, 0, 255, "dy1");
this.checkRange(dy2, 0, 255, "dy2");
this.checkRange(col1, 0, MAX_COL, "col1");
this.checkRange(col2, 0, MAX_COL, "col2");
this.checkRange(row1, 0, MAX_ROW, "row1");
this.checkRange(row2, 0, MAX_ROW, "row2");
this.setCol1((short)Math.min(col1, col2));
this.setCol2((short)Math.max(col1, col2));
this.setRow1(Math.min(row1, row2));
this.setRow2(Math.max(row1, row2));
if (col1 > col2) {
this._isHorizontallyFlipped = true;
}
if (row1 > row2) {
this._isVerticallyFlipped = true;
}
}
dx1 dy1 起始单元格中的x,y坐标.
dx2 dy2 结束单元格中的x,y坐标
col1,row1 指定起始的单元格,下标从0开始
col2,row2 指定结束的单元格 ,下标从0开始
用图来表达:
对应的代码:
标签:row1,HSSFClientAnchor,checkRange,int,col2,row2,col1,说明,参数 From: https://www.cnblogs.com/zhangpb/p/17381754.html