Package org.apache.poi.hslf.usermodel

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


    public void draw(Graphics2D graphics){
        AffineTransform at = graphics.getTransform();
        ShapePainter.paint(this, graphics);

        PictureData data = getPictureData();
        data.draw(graphics, this);

        graphics.setTransform(at);
    }
View Full Code Here


                Color color = f.getForegroundColor();
                graphics.setPaint(color);
                graphics.fill(anchor);
                break;
            case Fill.FILL_PICTURE:
                PictureData data = f.getPictureData();
                if (data instanceof Bitmap) {
                    BufferedImage img = null;
                    try {
                        img = ImageIO.read(new ByteArrayInputStream(data.getData()));
                    } catch (Exception e) {
                        logger.log(POILogger.WARN, "ImageIO failed to create image. image.type: " + data.getType());
                        return;
                    }
                    Image scaledImg = img.getScaledInstance(anchor.width, anchor.height, Image.SCALE_SMOOTH);
                    graphics.drawImage(scaledImg, anchor.x, anchor.y, null);
View Full Code Here

     * 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 setDefaultSize(){
        PictureData pict = getPictureData();
        if (pict  instanceof Bitmap){
            BufferedImage img = null;
            try {
                 img = ImageIO.read(new ByteArrayInputStream(pict.getData()));
            }
            catch (IOException e){}
            catch (NegativeArraySizeException ne) {}

            if(img != null) {
View Full Code Here

    public void draw(Graphics2D graphics){
        AffineTransform at = graphics.getTransform();
        ShapePainter.paint(this, graphics);

        PictureData data = getPictureData();
        if(data != null) data.draw(graphics, this);

        graphics.setTransform(at);
    }
View Full Code Here

     * 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 setDefaultSize(){
        PictureData pict = getPictureData();
        if (pict  instanceof Bitmap){
            BufferedImage img = null;
            try {
                 img = ImageIO.read(new ByteArrayInputStream(pict.getData()));
            }
            catch (IOException e){}
          catch (NegativeArraySizeException ne) {}
         
            if(img != null) {
View Full Code Here

TOP

Related Classes of org.apache.poi.hslf.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.