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 ImageDrawBeveledRect { 010 public static String call(PageContext pc, Object name, double x, double y, double width, double height) throws PageException { 011 return call(pc, name, x, y, width, height, false, false); 012 } 013 014 public static String call(PageContext pc, Object name, double x, double y, double width, double height, boolean raised) throws PageException { 015 return call(pc, name, x, y, width, height, raised, false); 016 } 017 018 public static String call(PageContext pc, Object name, double x, double y, double width, double height, boolean raised , boolean filled) throws PageException { 019 if(name instanceof String) name=pc.getVariable(Caster.toString(name)); 020 Image img = Image.toImage(name); 021 022 if (width < 0) 023 throw new FunctionException(pc,"ImageDrawBeveledRect",3,"width","width must contain a none negative value"); 024 if (height < 0) 025 throw new FunctionException(pc,"ImageDrawBeveledRect",4,"height","width must contain a none negative value"); 026 027 img.draw3DRect((int)x, (int)y, (int)width, (int)height, raised, filled); 028 return null; 029 } 030 031 }