customtools.htm
来自「applet在線上繪圖,允許在瀏覽器上繪圖,最後儲存成各式的圖檔」· HTM 代码 · 共 57 行
HTM
57 行
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Custom tools</title>
<link REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</head>
<body>
<a href="./index.htm">CONTENTS</a>
<h3>Custom tools</h3>
<p>You can create custom tools for the <a href="placing.htm#Tool">Tool Panel</a>.
Custom tools allow users to choose a basic tool (such as line, rectangle, ...), color, and pen by one mouse click.</p>
<p>Say you wish to allow your users to draw roads and rivers on a map.
<br>
Roads should be drawn with the <a href="placing.htm#Tool">line</a> tool, <nobr>in red color (#FF0000)</nobr>,
and the pen <a href="placing.htm#Pen">thick_rect2</a>.
<br>
River should be drawn with the <a href="placing.htm#Tool">curve</a> tool,
<nobr>in red color (#0000FF)</nobr>, with the pen <a href="placing.htm#Pen">thick_rect1</a>.</p>
<p>To implement these tools you have to do the following:</p>
<ol>
<li>Prepare a <a href="icons.htm">custom icons</a> for the road and river tools,
and name thier files road.gif and river.gif.
</li>
<li>Include the words <b>road</b> and <b>river</b> in the tool list defined
by the parameter <b>tool</b> of the <a href="placing.htm#Tool">Tool Panel</a>:
</li>
<li>Describe the new tools using parameters <b>road</b> and <b>river</b>.
The values of the parameters must be specified as:
<nobr><i>basic_tool, color, pen</i></nobr>
</li>
</ol>
Here is an example code describing the new custom tools:
<pre>
<applet code="ControlPanel.class" ... >
<param name="tools" value="road, river">
<param name="road" value="line, #FF0000, thick_rect2">
<param name="river" value="curve, #0000FF, thick_rect1">
...
</applet>
</pre>
<p><b>Note:</b> Custom tools can be used as an alternative to the basic tools, colors and pens.
Don't display the ColorPanel, and PenPanel if you're using custom tools, and don't mix custom
and basic tools on the tool panel.
</p>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?