Package org.jpedal.images

Examples of org.jpedal.images.ImageTransformer


            /**
             * scale the raw image to correct page size (at 72dpi)
             */
            //object to scale and clip. Creating instance does the scaling
            ImageTransformer image_transformation;

            //object to scale and clip. Creating instance does the scaling
            image_transformation =new ImageTransformer(PdfDecoder.dpi,gs,image,true);

            //get initial values
            x = image_transformation.getImageX();
            y = image_transformation.getImageY();
            w = image_transformation.getImageW();
            h = image_transformation.getImageH();

            //get back image, which will become null if TOO small
            image = image_transformation.getImage();

            //apply clip as well if exists and not inline image
            if (image != null && customImageHandler!=null && clipping_shape != null && clipping_shape.getBounds().getWidth()>1 &&
                    clipping_shape.getBounds().getHeight()>1 && !customImageHandler.imageHasBeenScaled()) {

                //see if clip is wider than image and ignore if so
                boolean ignore_image = clipping_shape.contains(x, y, w, h);

                if (!ignore_image) {
                    //do the clipping
                    image_transformation.clipImage(clipping_shape);

                    //get ALTERED values
                    x = image_transformation.getImageX();
                    y = image_transformation.getImageY();
                    w = image_transformation.getImageW();
                    h = image_transformation.getImageH();
                }
            }

            //alter image to allow for way we draw 'upside down'
            image = image_transformation.getImage();

            //allow for null image returned (ie if too small)
            if (image != null) {

                /**turn correct way round if needed*/
 
View Full Code Here

TOP

Related Classes of org.jpedal.images.ImageTransformer

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.