Package magick

Examples of magick.DrawInfo


                pixels[4 * i + 3] = (byte) 0;
            }
            blankImage.constituteImage(200, 100, "RGBA", pixels);

            // Put a red rectangle around the border
            DrawInfo drawInfo = new DrawInfo(new ImageInfo());
            drawInfo.setPrimitive("Rectangle 10 10 190 90");
            drawInfo.setStroke(PixelPacket.queryColorDatabase("red"));
            drawInfo.setFill(PixelPacket.queryColorDatabase("white"));
            blankImage.drawImage(drawInfo);

            // Annotate the image with a green Hello
            ImageInfo blankImageInfo = new ImageInfo();
            DrawInfo annotateInfo = new DrawInfo(blankImageInfo);
            annotateInfo.setOpacity(0);
            annotateInfo.setFont("fixed");
            annotateInfo.setFill(PixelPacket.queryColorDatabase("green"));
            annotateInfo.setText("Hello");
            annotateInfo.setGeometry("+30+30");
            blankImage.annotateImage(annotateInfo);

            blankImage.setFileName("blank.jpg");
            blankImage.writeImage(info);

View Full Code Here


  private static void imageMark(MagickImage image, ImageInfo info, int width,
      int height, int pos, int offsetX, int offsetY, String text,
      Color color, int size, int alpha) throws MagickException {
    Position p = ImageUtils.markPosition(width, height, pos, offsetX,
        offsetY);
    DrawInfo draw = new DrawInfo(info);
    int r = color.getRed();
    int g = color.getGreen();
    int b = color.getBlue();
    draw.setFill(new PixelPacket(r * r, g * g, b * b,
        65535 - (alpha * 65535 / 100)));
    draw.setPointsize(size);
    draw.setTextAntialias(true);
    draw.setText(text);
    draw.setGeometry("+" + p.getX() + "+" + p.getY());
    image.annotateImage(draw);
  }
View Full Code Here

TOP

Related Classes of magick.DrawInfo

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.