Search in sources :

Example 11 with Image

use of lucee.runtime.img.Image in project Lucee by lucee.

the class ImageRotateDrawingAxis method call.

public static String call(PageContext pc, Object name, double angle, double x, double y) throws PageException {
    // if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(pc, name);
    img.rotateAxis(angle, x, y);
    return null;
}
Also used : Image(lucee.runtime.img.Image)

Example 12 with Image

use of lucee.runtime.img.Image in project Lucee by lucee.

the class ImageSetAntialiasing method call.

public static String call(PageContext pc, Object name, String strAntialias) throws PageException {
    // if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(pc, name);
    strAntialias = strAntialias.trim().toLowerCase();
    boolean antialias;
    if ("on".equals(strAntialias))
        antialias = true;
    else if ("off".equals(strAntialias))
        antialias = false;
    else
        antialias = Caster.toBooleanValue(strAntialias);
    img.setAntiAliasing(antialias);
    return null;
}
Also used : Image(lucee.runtime.img.Image)

Example 13 with Image

use of lucee.runtime.img.Image in project Lucee by lucee.

the class ImageSetBackgroundColor method call.

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(pc, name);
    Color color = ColorCaster.toColor(strColor);
    img.setBackground(color);
    return null;
}
Also used : Color(java.awt.Color) Image(lucee.runtime.img.Image)

Example 14 with Image

use of lucee.runtime.img.Image in project Lucee by lucee.

the class ImageSetDrawingAlpha method call.

public static String call(PageContext pc, Object name, double alpha) throws PageException {
    // if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(pc, name);
    if (alpha < 0 || alpha > 1)
        throw new FunctionException(pc, "ImageSetDrawingAlpha", 2, "alpha", "alpha must be a value between 0 and 1");
    img.setAlpha((float) alpha);
    return null;
}
Also used : FunctionException(lucee.runtime.exp.FunctionException) Image(lucee.runtime.img.Image)

Example 15 with Image

use of lucee.runtime.img.Image in project Lucee by lucee.

the class ImageSetDrawingTransparency method call.

public static String call(PageContext pc, Object name, double percent) throws PageException {
    // if(name instanceof String) name=pc.getVariable(Caster.toString(name));
    Image img = Image.toImage(pc, name);
    if (percent < 0.0 || percent > 100.0)
        throw new FunctionException(pc, "ImageSetDrawingTransparency", 2, "percent", "value must be between 0 and 100");
    img.setTranparency((float) percent);
    return null;
}
Also used : FunctionException(lucee.runtime.exp.FunctionException) Image(lucee.runtime.img.Image)

Aggregations

Image (lucee.runtime.img.Image)38 FunctionException (lucee.runtime.exp.FunctionException)17 IOException (java.io.IOException)4 Color (java.awt.Color)3 Resource (lucee.commons.io.res.Resource)3 BufferedImage (java.awt.image.BufferedImage)2 ExpressionException (lucee.runtime.exp.ExpressionException)2 Paint (java.awt.Paint)1 Point (java.awt.Point)1 ArrayList (java.util.ArrayList)1 ShearDir (javax.media.jai.operator.ShearDir)1 TransposeType (javax.media.jai.operator.TransposeType)1 PageSource (lucee.runtime.PageSource)1 ConverterException (lucee.runtime.converter.ConverterException)1 Struct (lucee.runtime.type.Struct)1