Package com.google.appengine.api.images

Examples of com.google.appengine.api.images.Composite


            final String column = String.valueOf(RANDOM.nextInt(
                    MAX_CAPTCHA_COLUM));
            captcha += column;
            final String imageName = row + "/" + column + ".png";
            final Image captchaChar = CAPTCHAS.get(imageName);
            final Composite composite = ImagesServiceFactory.makeComposite(
                    captchaChar, i * WIDTH_CAPTCHA_CHAR, 0,
                    1.0F, Composite.Anchor.TOP_LEFT);
            composites.add(composite);
        }

View Full Code Here


      offsetWidth = (targetWidth - intWidth) / 2;

    if (targetHeight - intHeight > 0)
      offsetHeight = (targetHeight - intHeight) / 2;

    Composite c2 = ImagesServiceFactory.makeComposite(oldImage,
        offsetWidth, offsetHeight, (float) 1.0,
        Composite.Anchor.TOP_LEFT);
    composites.add(c2);
    return (imagesService.composite(composites, targetWidth, targetHeight,
        0, OutputEncoding.PNG));
View Full Code Here

    @Test
    public void testDefault() throws IOException {
        // w - 200, h - 143
        Image originalImage = readImage(CAPEDWARF_PNG);
        Composite c1 = ImagesServiceFactory.makeComposite(originalImage, 0, 0, 1, Composite.Anchor.BOTTOM_LEFT);
        Image ci = imagesService.composite(newArrayList(c1), 200, 143, 0);
        assertImages(null, originalImage, ci);

    }
View Full Code Here

    }

    @Test
    public void testEncoding() throws IOException {
        Image originalImage = readImage(CAPEDWARF_PNG);
        Composite c1 = ImagesServiceFactory.makeComposite(originalImage, 0, 0, 1, Composite.Anchor.BOTTOM_LEFT);
        Image ci = imagesService.composite(newArrayList(c1), 200, 143, 0, OutputEncoding.JPEG);
        assertImages(null, originalImage, ci);
    }
View Full Code Here

    }

    @Test
    public void testSettings() throws IOException {
        Image originalImage = readImage(CAPEDWARF_PNG);
        Composite c1 = ImagesServiceFactory.makeComposite(originalImage, 0, 0, 1, Composite.Anchor.BOTTOM_LEFT);
        Image ci = imagesService.composite(newArrayList(c1), 200, 143, 0, new OutputSettings(OutputEncoding.JPEG));
        assertImages(null, originalImage, ci);
    }
View Full Code Here

        for (int i = 0; i < length; i++) {
            final Image image = images.get(i);
            final byte[] imageData = image.getData();
            final com.google.appengine.api.images.Image gaeImage = ImagesServiceFactory.makeImage(imageData);

            final Composite composite = ImagesServiceFactory.makeComposite(
                    gaeImage, i * gaeImage.getWidth(), 0, 1.0F, Composite.Anchor.TOP_LEFT);
            composites.add(composite);

            if (i == length - 1) { // Using the last clip as the dimension of eatch one
                width = gaeImage.getWidth();
View Full Code Here

TOP

Related Classes of com.google.appengine.api.images.Composite

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.