Package org.apache.poi.ss.usermodel

Examples of org.apache.poi.ss.usermodel.PictureData


      Map<String, ExcelImportEntity> excelParams, String titleString,
      Map<String, PictureData> pictures, ImportParams params) throws Exception {
    if (pictures == null) {
      return;
    }
    PictureData image = pictures.get(picId);
    byte[] data = image.getData();
    String fileName = "pic"+Math.round(Math.random()*100000000000L);
    fileName+= "."+ExcelPublicUtil.getFileExtendName(data);
    if(excelParams.get(titleString).getSaveType()==1){
      String path = ContextHolderUtils.getRequest().getSession().getServletContext().getRealPath("\\") +
      getSaveUrl(excelParams.get(titleString),object);
View Full Code Here


     * @return the new Dimensions of the scaled picture in EMUs
     */
    public static Dimension setPreferredSize(Picture picture, double scaleX, double scaleY){
        ClientAnchor anchor = picture.getClientAnchor();
        boolean isHSSF = (anchor instanceof HSSFClientAnchor);
        PictureData data = picture.getPictureData();
        Sheet sheet = picture.getSheet();
       
        // in pixel
        Dimension imgSize = getImageDimension(new ByteArrayInputStream(data.getData()), data.getPictureType());
        // in emus
        Dimension anchorSize = ImageUtils.getDimensionFromAnchor(picture);
        final double scaledWidth = (scaleX == Double.MAX_VALUE)
            ? imgSize.getWidth() : anchorSize.getWidth()/EMU_PER_PIXEL * scaleX;
        final double scaledHeight = (scaleY == Double.MAX_VALUE)
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.usermodel.PictureData

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.