"Load filters" allow filtering an image when it's being loaded. The filter is defined by the DrawingCanvas parameter "loadfilter".
Example:
<applet width="400" height="300" code="DrawCanvas.class" ... >
<param name="load" value="picture.jpg">
<param name="loadfilter" value="GreyFilter">
....
</applet>
Filters are implemented as Java classes and should be located in the applet's directory or it's subdirectories
J-Painter package includes several filters. They are loacted in the applets subdirectory "loadfilters".
Scale Filter
Scales the image to the specified width and height.<param name="loadfilter" value="loadfilters.ScaleFilter?width=400&height=300" >
Gray Filter
Converts the color images to gray scale.<param name="loadfilter" value="loadfilters.GrayFilter" >
Sepia Filter
Implements sepia effect.<param name="loadfilter" value="loadfilters.SepiaFilter" >
Java developers can implement their own filters. A custom filter should extend
java.awt.image.ImageFilter and have the default public constructor.
The parameter "loadfilter" can optionally include filter parameters. The list of parameters should be separated from the class name by the '?' character. The parameters are defined as name=value pairs separated by '&'.
Example:
<param name="loadfilter" value="package.MyFilter?param1=val1¶m2=val2" >
If parameters are specified the filter class must have the public constructor YourFilter(Hashtable params).
Each parameter is represented by an entry in the Hashtable. The keys and values are of type java.lang.String.