Ejemplo n.º 1
0
  public static String call(PageContext pc, Object name, Object image, double x, double y)
      throws PageException {
    if (name instanceof String) name = pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);

    img.drawImage(Image.createImage(pc, image, true, false, true), (int) x, (int) y);
    return null;
  }
Ejemplo n.º 2
0
  public static String call(PageContext pc, Object name, double gain) throws PageException {
    if (name instanceof String) name = pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);

    if (gain < -1.0 || gain > 2.0)
      throw new FunctionException(pc, "ImageSharpen", 2, "gain", "value must be between 1 and 2");
    img.sharpen((float) gain);
    return null;
  }
Ejemplo n.º 3
0
  public static String call(
      PageContext pc, Object name, double x, double y, double width, double height, boolean filled)
      throws PageException {
    if (name instanceof String) name = pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);

    if (width < 0)
      throw new FunctionException(
          pc, "ImageDrawRect", 3, "width", "width must contain a none negative value");
    if (height < 0)
      throw new FunctionException(
          pc, "ImageDrawRect", 4, "height", "width must contain a none negative value");

    img.drawRect((int) x, (int) y, (int) width, (int) height, filled);
    return null;
  }
Ejemplo n.º 4
0
 /**
  * @param pc Page Context of the Request
  * @param query ZQLQuery
  * @return Railo Query
  * @throws PageException
  */
 private Query getSingleTable(PageContext pc, ZQuery query) throws PageException {
   return Caster.toQuery(pc.getVariable(((ZFromItem) query.getFrom().get(0)).getFullName()));
 }