⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loadfilters.htm

📁 applet在線上繪圖,允許在瀏覽器上繪圖,最後儲存成各式的圖檔
💻 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>
    &lt;applet width="400" height="300" code="DrawCanvas.class" ... &gt;
         &lt;param name="load" value="picture.jpg"&gt;
         &lt;param name="loadfilter" value="GreyFilter"&gt;
         ....
    &lt;/applet&gt;
</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>
   &lt;param name="loadfilter" value="loadfilters.ScaleFilter?width=400&amp;height=300" &gt;
</pre>


<p><b>Gray Filter</b></p>

Converts the color images to gray scale.<br>
Example:
<pre>
   &lt;param name="loadfilter" value="loadfilters.GrayFilter" &gt;
</pre>

<p><b>Sepia Filter</b></p>

Implements sepia effect.<br>
Example:
<pre>
   &lt;param name="loadfilter" value="loadfilters.SepiaFilter" &gt;
</pre>

<p>&nbsp;</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>
   &lt;param name="loadfilter" value="package.MyFilter?param1=val1&amp;param2=val2" &gt;
</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 + -