📄 loadfilters.htm
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Load filters</title>
<link REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</head>
<script language="javascript" src="../applet/applet.js"></script>
<body>
<a href="./index.htm">CONTENTS</a>
<h3>Load filters.</h3>
<p>"Load filters" allow filtering an image when it's being loaded. The filter is defined by
the <a href="placing.htm#DrawCanvas">DrawingCanvas</a> parameter "loadfilter".</p>
<p>Example:</p>
<pre>
<applet width="400" height="300" code="DrawCanvas.class" ... >
<param name="load" value="picture.jpg">
<param name="loadfilter" value="GreyFilter">
....
</applet>
</pre>
<p>Filters are implemented as Java classes and should be located in the applet's directory or it's subdirectories</p>
<h5>Filters included the package</h5>
<p>J-Painter package includes several filters. They are loacted in the applets subdirectory "loadfilters".</p>
<p><b>Scale Filter</b></p>
Scales the image to the specified width and height.<br>
Example:
<pre>
<param name="loadfilter" value="loadfilters.ScaleFilter?width=400&height=300" >
</pre>
<p><b>Gray Filter</b></p>
Converts the color images to gray scale.<br>
Example:
<pre>
<param name="loadfilter" value="loadfilters.GrayFilter" >
</pre>
<p><b>Sepia Filter</b></p>
Implements sepia effect.<br>
Example:
<pre>
<param name="loadfilter" value="loadfilters.SepiaFilter" >
</pre>
<p> </p>
<h5>Creating custom filters</h5>
<p>Java developers can implement their own filters. A custom filter should extend
<code>java.awt.image.ImageFilter</code> and have the default public constructor.</p>
<p>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 '&'.</p>
<p>Example:</p>
<pre>
<param name="loadfilter" value="package.MyFilter?param1=val1&param2=val2" >
</pre>
<p>If parameters are specified the filter class must have the public constructor <code>YourFilter(Hashtable params)</code>.
Each parameter is represented by an entry in the Hashtable. The keys and values are of type <code>java.lang.String</code>.</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -