001 package railo.runtime.functions.image; 002 003 import railo.runtime.PageContext; 004 import railo.runtime.exp.FunctionException; 005 import railo.runtime.exp.PageException; 006 import railo.runtime.img.Image; 007 import railo.runtime.op.Caster; 008 009 public class ImageSetDrawingTransparency { 010 011 public static String call(PageContext pc, Object name) throws PageException { 012 return call(pc, name,1.0); 013 } 014 public static String call(PageContext pc, Object name, double percent) throws PageException { 015 if(name instanceof String) name=pc.getVariable(Caster.toString(name)); 016 Image img = Image.toImage(name); 017 018 if (percent < 0.0 || percent > 100.0) 019 throw new FunctionException(pc,"ImageSetDrawingTransparency",2,"percent","value must be between 0 and 100"); 020 img.setTranparency((float)percent); 021 return null; 022 } 023 }