Package org.apache.poi.hssf.usermodel

Examples of org.apache.poi.hssf.usermodel.HSSFPicture


              anchor = toClientAnchor(anchorRecord);
            }else{
              anchor = toChildAnchor(childRecord);
            }

            HSSFPicture picture = new HSSFPicture( parent, anchor );
            picture.setPictureIndex( pictureIndex );

            addToParentOrContainer(picture, container, parent);
          }
          break;
        default:
View Full Code Here


      int index = workbook.addPicture(bytes, type);
      HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, row, column, row, column);

      HSSFPatriarch patriarch = s.createDrawingPatriarch();
      HSSFPicture picture = patriarch.createPicture(anchor, index);

      picture.resize();

      if ((width != 0) && (height != 0)) {
        picture.getImageDimension().setSize(width, height);
      }
    }
  }
View Full Code Here

                    x,
                    y,
                    (short) (x2 + 1),
                    y2 + 1);
            anchor.setAnchorType(2);
            HSSFPicture pic = patriarch.createPicture(anchor, idx);
            // pic.resize( );
        } else if (!suppressUnknownImage) {
            cell.setCellValue(new HSSFRichTextString("<<Unsupported Image>>")); //$NON-NLS-1$
        }
    }
View Full Code Here

            anchor.setDy1( anchorRecord.getDy1() );
            anchor.setDy2( anchorRecord.getDy2() );
            anchor.setRow1( anchorRecord.getRow1() );
            anchor.setRow2( anchorRecord.getRow2() );

            HSSFPicture picture = new HSSFPicture( null, anchor );
            picture.setPictureIndex( pictureIndex );
            patriarch.getChildren().add( picture );
          }
          break;
        default:
          log.log( POILogger.WARN, "Unhandled shape type: "
View Full Code Here

        shape = new TextboxShape(new HSSFTextbox(null, anchor), 1025);
        cmo = (CommonObjectDataSubRecord)shape.getObjRecord().getSubRecords().get(0);
        assertEquals(1, cmo.getObjectId());

        shape = new PictureShape(new HSSFPicture(null, anchor), 1026);
        cmo = (CommonObjectDataSubRecord)shape.getObjRecord().getSubRecords().get(0);
        assertEquals(2, cmo.getObjectId());

        shape = new CommentShape(new HSSFComment(null, anchor), 1027);
        cmo = (CommonObjectDataSubRecord)shape.getObjRecord().getSubRecords().get(0);
View Full Code Here

        List<HSSFPictureData> pictures = workbook.getAllPictures()
        if (pictures.size() != 0) { 
            for (HSSFShape shape : sheet.getDrawingPatriarch().getChildren()) { 
                HSSFClientAnchor anchor = (HSSFClientAnchor) shape.getAnchor()
                if (shape instanceof HSSFPicture) { 
                    HSSFPicture pic = (HSSFPicture) shape; 
                    int pictureIndex = pic.getPictureIndex() - 1
                    HSSFPictureData picData = pictures.get(pictureIndex)
                    String picIndex = String.valueOf(anchor.getRow1()) + "_" 
                            + String.valueOf(anchor.getCol1())
                    sheetIndexPicMap.put(picIndex, picData)
                }
View Full Code Here

      int index = workbook.addPicture(bytes, type);
      HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, row, column, row, column);

      HSSFPatriarch patriarch = s.createDrawingPatriarch();
      HSSFPicture picture = patriarch.createPicture(anchor, index);

      picture.resize();

      if ((width != 0) && (height != 0)) {
        picture.getImageDimension().setSize(width, height);
      }
    }
  }
View Full Code Here

      int index = workbook.addPicture(bytes, type);
      HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, row, column, row, column);

      HSSFPatriarch patriarch = s.createDrawingPatriarch();
      HSSFPicture picture = patriarch.createPicture(anchor, index);

      picture.resize();

      if ((width != 0) && (height != 0)) {
        picture.getImageDimension().setSize(width, height);
      }
    }
  }
View Full Code Here

            EscherClientAnchorRecord anchorRecord = (EscherClientAnchorRecord) getEscherChild(
                shapeContainer,
                EscherClientAnchorRecord.RECORD_ID );
                        HSSFClientAnchor anchor = toClientAnchor(anchorRecord);

            HSSFPicture picture = new HSSFPicture( null, anchor );
            picture.setPictureIndex( pictureIndex );
            patriarch.addShape( picture );
          }
          break;
        default:
          log.log( POILogger.WARN, "Unhandled shape type: "
View Full Code Here

      int index = workbook.addPicture(bytes, type);
      HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, row, column, row, column);

      HSSFPatriarch patriarch = s.createDrawingPatriarch();
      HSSFPicture picture = patriarch.createPicture(anchor, index);

      picture.resize();

      if ((width != 0) && (height != 0)) {
        picture.getImageDimension().setSize(width, height);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.usermodel.HSSFPicture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.