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

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

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

HSSFPicture.setParent介绍

暂无

代码示例

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

/**
 * Creates a picture.
 *
 * @param anchor the client anchor describes how this group is attached
 *               to the sheet.
 * @return the newly created shape.
 */
public HSSFPicture createPicture(HSSFChildAnchor anchor, int pictureIndex) {
  HSSFPicture shape = new HSSFPicture(this, anchor);
  shape.setParent(this);
  shape.setAnchor(anchor);
  shape.setPictureIndex(pictureIndex);
  shapes.add(shape);
  onCreate(shape);
  EscherSpRecord sp = shape.getEscherContainer().getChildById(EscherSpRecord.RECORD_ID);
  if (shape.getAnchor().isHorizontallyFlipped()){
    sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPHORIZ);
  }
  if (shape.getAnchor().isVerticallyFlipped()){
    sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPVERT);
  }
  return shape;
}

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

/**
 * Creates a picture.
 *
 * @param anchor the client anchor describes how this group is attached
 *               to the sheet.
 * @return the newly created shape.
 */
public HSSFPicture createPicture(HSSFChildAnchor anchor, int pictureIndex) {
  HSSFPicture shape = new HSSFPicture(this, anchor);
  shape.setParent(this);
  shape.setAnchor(anchor);
  shape.setPictureIndex(pictureIndex);
  shapes.add(shape);
  onCreate(shape);
  EscherSpRecord sp = shape.getEscherContainer().getChildById(EscherSpRecord.RECORD_ID);
  if (shape.getAnchor().isHorizontallyFlipped()){
    sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPHORIZ);
  }
  if (shape.getAnchor().isVerticallyFlipped()){
    sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPVERT);
  }
  return shape;
}

代码示例来源:origin: com.haulmont.thirdparty/poi

/**
 * Creates a picture.
 *
 * @param anchor the client anchor describes how this group is attached
 *               to the sheet.
 * @return the newly created shape.
 */
public HSSFPicture createPicture(HSSFChildAnchor anchor, int pictureIndex) {
  HSSFPicture shape = new HSSFPicture(this, anchor);
  shape.setParent(this);
  shape.setAnchor(anchor);
  shape.setPictureIndex(pictureIndex);
  shapes.add(shape);
  onCreate(shape);
  EscherSpRecord sp = shape.getEscherContainer().getChildById(EscherSpRecord.RECORD_ID);
  if (shape.getAnchor().isHorizontallyFlipped()){
    sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPHORIZ);
  }
  if (shape.getAnchor().isVerticallyFlipped()){
    sp.setFlags(sp.getFlags() | EscherSpRecord.FLAG_FLIPVERT);
  }
  return shape;
}

相关文章