Package railo.runtime.img

Examples of railo.runtime.img.Image


public class ImageReadBase64 implements Function {
 
  public static Object call(PageContext pc, String source) throws PageException {
    try {
      return new Image(source);
    } catch (IOException e) {
      throw Caster.toPageException(e);
    }
  }
View Full Code Here


  }
 
  public static String call(PageContext pc, Object name, String destination, double quality, boolean overwrite) throws PageException {
    if(name instanceof String)
      name=pc.getVariable(Caster.toString(name));
    Image image=Image.toImage(name);
   
    if(quality<0 || quality>1)
      throw new FunctionException(pc,"ImageWrite",3,"quality","value have to be between 0 and 1");
   
    // MUST beide boolschen argumente checken
    if(destination==null) return null;
    try {
      image.writeOut(ResourceUtil.toResourceNotExisting(pc, destination), overwrite , (float)quality);
    } catch (IOException e) {
      throw Caster.toPageException(e);
    }
    return null;
  }
View Full Code Here

public class ImageDrawPoint {

  public static String call(PageContext pc, Object name, double x, double y) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
    img.drawPoint((int)x, (int)y);
    return null;
  }
View Full Code Here

public class ImageGetEXIFMetadata {

  public static Struct call(PageContext pc, Object name) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
    return getData(img);
  }
View Full Code Here

public class ImageClearRect {

  public static String call(PageContext pc, Object name, double x, double y, double width, double height) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   

    if (width < 0)
        throw new FunctionException(pc,"ImageClearRect",3,"width","width must contain a none negative value");
    if (height < 0)
        throw new FunctionException(pc,"ImageClearRect",4,"height","width must contain a none negative value");
   
    img.clearRect((int)x, (int)y, (int)width, (int)height);
    return null;
  }
View Full Code Here

public class ImageSetBackgroundColor {

  public static String call(PageContext pc, Object name, String strColor) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
    Color color = ColorCaster.toColor(strColor);
   
    img.setBackground(color);
    return null;
  }
View Full Code Here

  }
 
  public static String call(PageContext pc, Object name, String destination, String format, boolean inHTMLFormat) throws PageException {
    if(name instanceof String)
      name=pc.getVariable(Caster.toString(name));
    Image image=Image.toImage(name);
    try {
      return image.writeBase64(ResourceUtil.toResourceNotExisting(pc, destination), format, inHTMLFormat);
    } catch (IOException e) {
      throw Caster.toPageException(e);
    }
   
  }
View Full Code Here

      double x1, double y1,
      double ctrlx1, double ctrly1,
      double ctrlx2, double ctrly2,
      double x2, double y2) throws PageException {
    if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(name);
   
    img.drawCubicCurve(ctrlx1, ctrly1, ctrlx2, ctrly2, x1, y1, x2, y2);
    return null;
  }
View Full Code Here

public class ImageDrawImage {
 
  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,null), (int)x, (int)y);
    return null;
  }
View Full Code Here

 
  public static String call(PageContext pc, Object name,String width, String height,String interpolation, double blurFactor) throws PageException {
    // image
    if(name instanceof String)
      name=pc.getVariable(Caster.toString(name));
    Image image=Image.toImage(name);
   
    interpolation = interpolation.toLowerCase().trim();
   
   
    if (blurFactor <= 0.0 || blurFactor > 10.0)
      throw new FunctionException(pc,"ImageResize",5,"blurFactor","argument blurFactor must be between 0 and 10");
     
   
    // MUST interpolation/blur
    //if(!"highestquality".equals(interpolation) || blurFactor!=1.0)throw new ExpressionException("argument interpolation and blurFactor are not supported for function ImageResize");
   
    image.resize(width,height,interpolation,blurFactor);
    return null;
  }
View Full Code Here

TOP

Related Classes of railo.runtime.img.Image

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.