org.apache.poi.hssf.usermodel.HSSFSheet.setZoom()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(164)

本文整理了Java中org.apache.poi.hssf.usermodel.HSSFSheet.setZoom()方法的一些代码示例,展示了HSSFSheet.setZoom()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFSheet.setZoom()方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFSheet
类名称:HSSFSheet
方法名:setZoom

HSSFSheet.setZoom介绍

[英]Window zoom magnification for current view representing percent values. Valid values range from 10 to 400. Horizontal & Vertical scale together. For example:

10 - 10% 
20 - 20% 
... 
100 - 100% 
... 
400 - 400%

[中]当前视图的窗口缩放比例,表示百分比值。有效值范围为10到400。水平和垂直比例在一起。例如:

10 - 10% 
20 - 20% 
... 
100 - 100% 
... 
400 - 400%

代码示例

代码示例来源:origin: org.apache.poi/poi

/**
 * Window zoom magnification for current view representing percent values.
 * Valid values range from 10 to 400. Horizontal & Vertical scale together.
 *
 * For example:
 * <pre>
 * 10 - 10%
 * 20 - 20%
 * ...
 * 100 - 100%
 * ...
 * 400 - 400%
 * </pre>
 *
 * @param scale window zoom magnification
 * @throws IllegalArgumentException if scale is invalid
 */
@Override
public void setZoom(int scale) {
  setZoom(scale, 100);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Window zoom magnification for current view representing percent values.
 * Valid values range from 10 to 400. Horizontal &amp; Vertical scale together.
 *
 * For example:
 * <pre>
 * 10 - 10%
 * 20 - 20%
 * ...
 * 100 - 100%
 * ...
 * 400 - 400%
 * </pre>
 *
 * @param scale window zoom magnification
 * @throws IllegalArgumentException if scale is invalid
 */
@Override
public void setZoom(int scale) {
  setZoom(scale, 100);
}

代码示例来源:origin: org.apache.poi/poi-examples

public static void main(String[] args) throws IOException {
    try (HSSFWorkbook wb = new HSSFWorkbook()) {
      HSSFSheet sheet1 = wb.createSheet("new sheet");
      sheet1.setZoom(75);   // 75 percent magnification

      try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
        wb.write(fileOut);
      }
    }
  }
}

相关文章

微信公众号

最新文章

更多

HSSFSheet类方法