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

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

本文整理了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:

  1. 10 - 10%
  2. 20 - 20%
  3. ...
  4. 100 - 100%
  5. ...
  6. 400 - 400%

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

  1. 10 - 10%
  2. 20 - 20%
  3. ...
  4. 100 - 100%
  5. ...
  6. 400 - 400%

代码示例

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

  1. /**
  2. * Window zoom magnification for current view representing percent values.
  3. * Valid values range from 10 to 400. Horizontal & Vertical scale together.
  4. *
  5. * For example:
  6. * <pre>
  7. * 10 - 10%
  8. * 20 - 20%
  9. * ...
  10. * 100 - 100%
  11. * ...
  12. * 400 - 400%
  13. * </pre>
  14. *
  15. * @param scale window zoom magnification
  16. * @throws IllegalArgumentException if scale is invalid
  17. */
  18. @Override
  19. public void setZoom(int scale) {
  20. setZoom(scale, 100);
  21. }

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

  1. /**
  2. * Window zoom magnification for current view representing percent values.
  3. * Valid values range from 10 to 400. Horizontal &amp; Vertical scale together.
  4. *
  5. * For example:
  6. * <pre>
  7. * 10 - 10%
  8. * 20 - 20%
  9. * ...
  10. * 100 - 100%
  11. * ...
  12. * 400 - 400%
  13. * </pre>
  14. *
  15. * @param scale window zoom magnification
  16. * @throws IllegalArgumentException if scale is invalid
  17. */
  18. @Override
  19. public void setZoom(int scale) {
  20. setZoom(scale, 100);
  21. }

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

  1. public static void main(String[] args) throws IOException {
  2. try (HSSFWorkbook wb = new HSSFWorkbook()) {
  3. HSSFSheet sheet1 = wb.createSheet("new sheet");
  4. sheet1.setZoom(75); // 75 percent magnification
  5. try (FileOutputStream fileOut = new FileOutputStream("workbook.xls")) {
  6. wb.write(fileOut);
  7. }
  8. }
  9. }
  10. }

相关文章

HSSFSheet类方法