how to scale image
i am working with JAI and have to scale image. it has to be enlarged or shrinked. supposed i have image and i want to increase it's size upto 200% of actual size(not memory size).
i tried this
// Create a ParameterBlock and specify the source and
// parameters
ParameterBlock pb =new ParameterBlock();
pb.addSource(im);// The source image
pb.add(1.2);// The xScale
pb.add(1.2);// The yScale
pb.add(0.0F);// The x translation
pb.add(0.0F);// The y translation
pb.add(new InterpolationNearest());// The interpolation
// Create the scale operation
im = JAI.create("scale", pb,null);
but facing exception.
Exception in thread "main" java.lang.IllegalArgumentException: Scale - Parameter value`s class ([D) is not an instance of the parameter class (java.lang.Float) for parameter "xScale".
Any thoughts or suggestions?
Prashant

