Package org.apache.poi.hslf.model

Examples of org.apache.poi.hslf.model.Picture


        SlideShow ppt = new SlideShow();

        Slide slide = ppt.createSlide();
        byte[] img = slTests.readFile("tomcat.png");
        int idx = ppt.addPicture(img, Picture.PNG);
        Picture pict = new Picture(idx);
        pict.setPictureName("tomcat.png");
        slide.addShape(pict);

        //serialize and read again
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ppt.write(out);
        out.close();

        ppt = new SlideShow(new ByteArrayInputStream(out.toByteArray()));

        Picture p = (Picture)ppt.getSlides()[0].getShapes()[0];
        assertEquals("tomcat.png", p.getPictureName());
    }
View Full Code Here


        SlideShow ppt = new SlideShow(hslf);

        //test case from the bug report
        ShapeGroup shapeGroup = (ShapeGroup)ppt.getSlides()[11].getShapes()[10];
        Picture picture = (Picture)shapeGroup.getShapes()[0];
        picture.getPictureData();

        //walk down the tree and see if there were no errors while reading
        Slide[] slide = ppt.getSlides();
        for (int i = 0; i < slide.length; i++) {
            Shape[] shape = slide[i].getShapes();
View Full Code Here

        SlideShow ppt = new SlideShow(hslf);

        //test case from the bug report
        ShapeGroup shapeGroup = (ShapeGroup)ppt.getSlides()[11].getShapes()[10];
        Picture picture = (Picture)shapeGroup.getShapes()[0];
        picture.getPictureData();

        //walk down the tree and see if there were no errors while reading
        Slide[] slide = ppt.getSlides();
        for (int i = 0; i < slide.length; i++) {
            Shape[] shape = slide[i].getShapes();
View Full Code Here

        SlideShow ppt = new SlideShow(hslf);

        //test case from the bug report
        ShapeGroup shapeGroup = (ShapeGroup)ppt.getSlides()[11].getShapes()[10];
        Picture picture = (Picture)shapeGroup.getShapes()[0];
        picture.getPictureData();

        //walk down the tree and see if there were no errors while reading
        Slide[] slide = ppt.getSlides();
        for (int i = 0; i < slide.length; i++) {
            Shape[] shape = slide[i].getShapes();
View Full Code Here

            try {
              pathImagemParecer = noParecerCorrente.getAttributes().getNamedItem("caminhoImagem").getNodeValue().toString();
              int beginIndex = pathImagemParecer.lastIndexOf("/");
              pathImagemParecer = caminhoImagens + pathImagemParecer.substring(beginIndex, pathImagemParecer.length());
              int idImagemParecer = ppt.addPicture(new File(pathImagemParecer), Picture.PNG);
              Picture imagemParecer = new Picture(idImagemParecer);
              imagemParecer.setAnchor(new java.awt.Rectangle(12, 190 + incrementoParaOutroParecer, 21,21));         
              s1.addShape(imagemParecer);
            } catch (Exception e) {
              System.out.println("Imagem n�o econtrada:" + pathImagemParecer);
            }
          
View Full Code Here

       
        try {

          // Inserindo a imagem do cabe�alho do PPT
            int idx = ppt.addPicture(new File(pathRaiz + empresa.getLogotipoRelatorioEmp()), Picture.PNG);
            Picture pict = new Picture(idx);
            pict.setAnchor(new java.awt.Rectangle(0, 0, 790,69));          
            s1.addShape(pict);
        } catch (Exception e) {
        System.out.println("Imagem n�o econtrada: "+ pathRaiz + empresa.getLogotipoRelatorioEmp());
      }
       
View Full Code Here

            Slide sl = slide[i];
            Shape[] sh = sl.getShapes();
            for (int j = 0; j < sh.length; j++) {
                Shape shape = sh[j];
                if (shape instanceof Picture){
                    Picture picture = (Picture)shape;

                    PictureData pictdata = picture.getPictureData();
                    assertEquals(Picture.PNG, pictdata.getType());

                    //raw data.
                    byte[] data = pictdata.getData();
                    BufferedImage img = ImageIO.read(new ByteArrayInputStream(data));
View Full Code Here

    }

    public void testAddPictures() throws Exception {
        int idx;
        Slide slide;
        Picture pict;

        SlideShow ppt = new SlideShow();

        idx = ppt.addPicture(new File(dirname + "/clock.jpg"), Picture.JPEG);
        slide = ppt.createSlide();
        pict = new Picture(idx);
        slide.addShape(pict);

        idx = ppt.addPicture(new File(dirname + "/painting.png"), Picture.PNG);
        pict = new Picture(idx);
        slide.addShape(pict);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ppt.write(out);
        out.close();
View Full Code Here

        SlideShow ppt = new SlideShow(hslf);

        //test case from the bug report
        ShapeGroup shapeGroup = (ShapeGroup)ppt.getSlides()[11].getShapes()[10];
        Picture picture = (Picture)shapeGroup.getShapes()[0];
        picture.getPictureData();

        //walk down the tree and see if there were no errors while reading
        Slide[] slide = ppt.getSlides();
        for (int i = 0; i < slide.length; i++) {
            Shape[] shape = slide[i].getShapes();
View Full Code Here

        SlideShow ppt = new SlideShow(hslf);

        //test case from the bug report
        ShapeGroup shapeGroup = (ShapeGroup)ppt.getSlides()[11].getShapes()[10];
        Picture picture = (Picture)shapeGroup.getShapes()[0];
        picture.getPictureData();

        //walk down the tree and see if there were no errors while reading
        Slide[] slide = ppt.getSlides();
        for (int i = 0; i < slide.length; i++) {
            Shape[] shape = slide[i].getShapes();
View Full Code Here

TOP

Related Classes of org.apache.poi.hslf.model.Picture

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.