gpt4 book ai didi

org.apache.poi.xslf.usermodel.XSLFPictureShape.getPictureData()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 13:29:40 26 4
gpt4 key购买 nike

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

XSLFPictureShape.getPictureData介绍

[英]Return the data on the (internal) picture. For an external linked picture, will return null
[中]返回(内部)图片上的数据。对于外部链接图片,将返回null

代码示例

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

} else if (shape instanceof XSLFPictureShape) {
  XSLFPictureShape p = (XSLFPictureShape)shape;
  XSLFPictureData pd = p.getPictureData();
  XSLFPictureData pdNew = getSheet().getSlideShow().addPicture(pd.getData(), pd.getType());
  newShape = createPicture(pdNew);

代码示例来源:origin: stackoverflow.com

for(XSLFShape shape : slide.getShapes()) {

  XSLFPictureShape image = (XSLFPictureShape) shape;
  image.getPictureData().setData(IOUtils.toByteArray(new  FileInputStream("path_to_image"));

}

代码示例来源:origin: stackoverflow.com

for(XSLFShape shape : mySlide){
  if (shape instanceof XSLFPictureShape){
    XSLFPictureShape pShape = (XSLFPictureShape)shape;
    XSLFPictureData pData = pShape.getPictureData();
    InputStream pIs = pData.getInputStream();
    // ...
  }
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * Resize this picture to the default size.
 * For PNG and JPEG resizes the image to 100%,
 * for other types sets the default size of 200x200 pixels.
 */
public void resize() {
  XSLFPictureData pict = getPictureData();
  try {
    BufferedImage img = ImageIO.read(new ByteArrayInputStream(pict.getData()));
    setAnchor(new Rectangle2D.Double(0, 0, img.getWidth(), img.getHeight()));
  }
  catch (Exception e) {
    //default size is 200x200
    setAnchor(new java.awt.Rectangle(50, 50, 200, 200));
  }
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

@Override
public void drawContent(Graphics2D graphics) {
  XSLFPictureData data = getPictureData();
  if(data == null) return;
  XSLFImageRenderer renderer = (XSLFImageRenderer)graphics.getRenderingHint(XSLFRenderingHint.IMAGE_RENDERER);
  if(renderer == null) renderer = new XSLFImageRenderer();
  RenderableShape rShape = new RenderableShape(this);
  Rectangle2D anchor = rShape.getAnchor(graphics);
  renderer.drawImage(graphics, data, anchor);
}

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

} else if (shape instanceof XSLFPictureShape) {
  XSLFPictureShape pShape = (XSLFPictureShape) shape;
  XSLFPictureData pData = pShape.getPictureData();
  out.println(pData.getFileName());
} else {

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

} else if (shape instanceof XSLFPictureShape) {
  XSLFPictureShape p = (XSLFPictureShape)shape;
  XSLFPictureData pd = p.getPictureData();
  XSLFPictureData pdNew = getSheet().getSlideShow().addPicture(pd.getData(), pd.getType());
  newShape = createPicture(pdNew);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com