Hallo 
    
   I want to get a Picture from a workbook, I can get the Image in
excel2003, but not in excel 2007. code as follows
      
                // get all pictures
                List<XSSFPictureData> pictures = workbook.getAllPictures();

                XSSFSheet sheet = workbook.getSheetAt(0);

                //Make a mapping of Interger and XSSFPictureData
                Map<Integer,XSSFPictureData> map = new 
HashMap<Integer,XSSFPictureData>();

                for (XSSFShape shape : 
sheet.getDrawingPatriarch().getChildren()) {

                        XSSFClientAnchor anchor = (XSSFClientAnchor) 
shape.getAnchor();
                        int rowIndex = anchor.getRow1();
                        if (shape instanceof XSSFPicture) {
                                int rowmark = rowIndex;
                                XSSFPicture picture = (XSSFPicture) shape;
                                int pictureIndex = picture.getPictureIndex() - 
1;
                                XSSFPictureData pictureData = 
pictures.get(pictureIndex);//
                                map.put(rowmark, pictureData);


In HSSFSheet and HSSFPicture have the method sheet.getDrawingPatriarch() and 
getPictureIndex(). But there is no such method getDrawingPatriarch() in
XSSFSheet and getPictureIndex() in XSSFPicture, Is there any way to get
location of Picture and Index of Picture. 

I am using POI-3.8

Regards




--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/get-Image-from-excel-2010-tp5710579.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to