Package com.jeecms.common.image.ImageUtils

Examples of com.jeecms.common.image.ImageUtils.Position


   * @throws IOException
   */
  private static void imageMark(BufferedImage imgBuff, int width, int height,
      int pos, int offsetX, int offsetY, String text, Color color,
      int size, int alpha) throws IOException {
    Position p = ImageUtils.markPosition(width, height, pos, offsetX,
        offsetY);
    Graphics2D g = imgBuff.createGraphics();
    g.setColor(color);
    g.setFont(new Font(null, Font.PLAIN, size));
    AlphaComposite a = AlphaComposite.getInstance(AlphaComposite.SRC_ATOP,
        (float) alpha / 100);
    g.setComposite(a);
    g.drawString(text, p.getX(), p.getY());
    g.dispose();
  }
View Full Code Here


  }

  private static void imageMark(BufferedImage imgBuff, int width, int height,
      int pos, int offsetX, int offsetY, File markFile)
      throws IOException {
    Position p = ImageUtils.markPosition(width, height, pos, offsetX,
        offsetY);
    Graphics2D g = imgBuff.createGraphics();
    AlphaComposite a = AlphaComposite.getInstance(AlphaComposite.SRC_ATOP);
    g.setComposite(a);
    g.drawImage(ImageIO.read(markFile), p.getX(), p.getY(), null);
    g.dispose();
  }
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

  }

  private static void imageMark(MagickImage image, ImageInfo info, int width,
      int height, int pos, int offsetX, int offsetY, File markFile)
      throws MagickException {
    Position p = ImageUtils.markPosition(width, height, pos, offsetX,
        offsetY);
    MagickImage mark = new MagickImage(new ImageInfo(markFile
        .getAbsolutePath()));
    image.compositeImage(CompositeOperator.AtopCompositeOp, mark, p.getX(),
        p.getY());
    mark.destroyImages();
  }
View Full Code Here

TOP

Related Classes of com.jeecms.common.image.ImageUtils.Position

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.