Package org.apache.xmlgraphics.image.loader.impl

Examples of org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D


                return new Dimension(svg.getSize().getWidthMpt(), svg.getSize().getHeightMpt());
            }

        };

        ImageGraphics2D g2dImage = new ImageGraphics2D(src.getInfo(), painter);
        return g2dImage;
    }
View Full Code Here


                org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                        info, FLAVORS, hints, sessionContext);
               
                //...and process the image
                if (img instanceof ImageGraphics2D) {
                    ImageGraphics2D imageG2D = (ImageGraphics2D)img;
                    RendererContext context = createRendererContext(
                            posInt.x, posInt.y,
                            posInt.width, posInt.height, foreignAttributes);
                    getGraphics2DAdapter().paintImage(imageG2D.getGraphics2DImagePainter(),
                            context,
                            origin.x + posInt.x, origin.y + posInt.y,
                            posInt.width, posInt.height);
                } else if (img instanceof ImageRendered) {
                    ImageRendered imgRend = (ImageRendered)img;
View Full Code Here

            org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                    info, FLAVORS, hints, sessionContext);
           
            //...and process the image
            if (img instanceof ImageGraphics2D) {
                ImageGraphics2D imageG2D = (ImageGraphics2D)img;
                RendererContext context = createRendererContext(
                        posInt.x, posInt.y,
                        posInt.width, posInt.height, foreignAttributes);
                getGraphics2DAdapter().paintImage(imageG2D.getGraphics2DImagePainter(),
                        context, x, y, posInt.width, posInt.height);
            } else if (img instanceof ImageRendered) {
                ImageRendered imgRend = (ImageRendered)img;
                RenderedImage ri = imgRend.getRenderedImage();
                setCursorPos(x, y);
View Full Code Here

                this.imageManager.getImageContext(), null);
       
        //Construct URI from filename
        String uri = f.toURI().toASCIIString();
       
        ImageGraphics2D g2dImage = null;
        try {
            //Preload image
            ImageInfo info = this.imageManager.getImageInfo(uri, sessionContext);
           
            //Load image and request Graphics2D image
View Full Code Here

        size.setResolution(imageManager.getImageContext().getSourceResolution());
        size.calcPixelsFromSize();
       
        ImageInfo info = new ImageInfo(null, null);
        info.setSize(size);
        return new ImageGraphics2D(info, painter);
    }
View Full Code Here

        size.setResolution(72);
        size.calcPixelsFromSize();
       
        ImageInfo info = new ImageInfo(null /*null is the intention here*/, null);
        info.setSize(size);
        ImageGraphics2D g2dImage = new ImageGraphics2D(info, painter);
        return g2dImage;
    }
View Full Code Here

                org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                        info, getInlineFlavors(), hints, sessionContext);
               
                //...and embed as inline image
                if (img instanceof ImageGraphics2D) {
                    ImageGraphics2D imageG2D = (ImageGraphics2D)img;
                    RendererContext context = createRendererContext(
                            x, y, width, height, foreignAttributes);
                    getGraphics2DAdapter().paintImage(imageG2D.getGraphics2DImagePainter(),
                            context, x, y, width, height);
                } else if (img instanceof ImageRendered) {
                    ImageRendered imgRend = (ImageRendered)img;
                    RenderedImage ri = imgRend.getRenderedImage();
                    PSImageUtils.renderBitmapImage(ri, ptx, pty, ptw, pth, gen);
View Full Code Here

                String imageDescription = info.getMimeType() + " " + info.getOriginalURI();
                final Dimension2D dimensionsPt = info.getSize().getDimensionPt();
                final Dimension2D dimensionsMpt = info.getSize().getDimensionMpt();

                if (img instanceof ImageGraphics2D) {
                    final ImageGraphics2D imageG2D = (ImageGraphics2D)img;
                    FormGenerator formGen = new FormGenerator(
                            form.getName(), imageDescription, dimensionsPt) {

                        protected void generatePaintProc(PSGenerator gen)
                                throws IOException {
                            gen.getResourceTracker().notifyResourceUsageOnPage(
                                    PSProcSets.EPS_PROCSET);
                            gen.writeln("BeginEPSF");
                            PSGraphics2DAdapter adapter = new PSGraphics2DAdapter(gen, false);
                            adapter.paintImage(imageG2D.getGraphics2DImagePainter(),
                                    null,
                                    0, 0,
                                    (int)Math.round(dimensionsMpt.getWidth()),
                                    (int)Math.round(dimensionsMpt.getHeight()));
                            gen.writeln("EndEPSF");
View Full Code Here

            if (image instanceof ImageRawJPEG) {
                specializedNode = new LoaderImageNode(image, ctx, imageElement, purl);
            } else if (image instanceof ImageRawCCITTFax) {
                specializedNode = new LoaderImageNode(image, ctx, imageElement, purl);
            } else if (image instanceof ImageGraphics2D) {
                ImageGraphics2D g2dImage = (ImageGraphics2D)image;
                specializedNode = new Graphics2DNode(g2dImage);
            } else {
                ctx.getUserAgent().displayError(
                        new ImageException("Cannot convert an image to a usable format: " + purl));
            }
View Full Code Here

                    }
                   
                };
               
                //The whole image had to be loaded for this, so keep it
                Image image = new ImageGraphics2D(info, painter);
                info.getCustomObjects().put(ImageInfo.ORIGINAL_IMAGE, image);
               
                return info;
            } catch (NoClassDefFoundError ncdfe) {
                try {
View Full Code Here

TOP

Related Classes of org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D

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.