| <SCRIPT
language="javascript"
type="text/javascript"
src="http://homepage2.nifty.com/lightbox/wz_jsgraphics.js">
</SCRIPT>
<INPUT
onclick="drawLine();"
type="button"
value="図形を描画する" />
<INPUT
onclick="draw.clear();"
type="button"
value="クリア" />
<DIV style="POSITION: relative">
<DIV id="myArea"></DIV>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
</DIV>
<SCRIPT language="javascript" type="text/javascript">
draw = new jsGraphics("myArea");
function drawLine() {
// drawLine(X1, Y1, X2, Y2);
var base = 60;
draw.setColor("#ff0000");
draw.setStroke( -1 );
draw.drawLine(50, base+50, 200, base+50);
draw.drawLine(50, base+50, 200, base+100);
base += 200;
draw.setColor("#D90D91");
draw.setStroke( 1 );
draw.fillRect(50, base+50, 200, 50);
base += 100;
draw.setColor("#000");
draw.setStroke( 5 );
var Xpoints = new Array(10,85,93,60);
var Ypoints = new Array(base+50,base+10,base+105,base+87);
draw.drawPolygon(Xpoints, Ypoints);
draw.paint();
}
</SCRIPT>
| |