問題:
畫頁面 或 報表 的 圖象問題
解決:用 通過xml畫圖? 畫筆wz_jsgraphics.js?
??? ??? ??? ??? ??? ? xml數據取得 prototype.js
??? ?? ?? ?? ?? ?? ?? 畫動作 Xmlgraphics.js (自己包裝)
??? 下載:
http://www.tkk7.com/Files/Good-Game/Mywz_jsgraphics.rar? 請放在 服務器上(tomcat) 并改 ?? ??? ??? ??? ??? ??? ? testLine.html頁面上的 load( ul ) =>>?
ul ( xml 的取得地方 )
??????????? 請注意 : IE 5 支持不好 請用 火狐 或 IE6
圖片 :

EG:
?? 這展現了 畫線 畫圖? 到 畫字的簡單過程
<grabhics>
????<line?x1='0'?y1='0'?x2='40'?y2='0'?color='green'??stroke='4'?/>
????<line?id='l1'?x1='0'?y1='0'?x2='0'?y2='200'?color='darkblue'??stroke='8'?/>
????
????<rect?x='20'?y='20'?w='40'?h='70'?color='hotpink'??stroke='4'?/>
????<rect?id='r1'?x='100'?y='60'?w='20'?h='200'?color='greenyellow'??stroke='8'?/>
????
????<fillRect?x='50'?y='60'?w='40'?h='70'?color='darkolivegreen'??stroke='2'?/>
????<fillRect?id='fr1'?x='150'?y='250'?w='20'?h='45'?color='darkturquoise'??stroke='1'?/>
????
????<ellipse?x='0'?y='100'?w='50'?h='100'?color='darkolivegreen'??stroke='5'?/>
????<ellipse?id='e1'?x='250'?y='0'?w='34'?h='46'?color='darkturquoise'??stroke='7'?/>
????
????<fillEllipse?x='0'?y='150'?w='150'?h='70'?color='darkolivegreen'??stroke='5'?/>
????<fillEllipse?id='fe1'?x='250'?y='20'?w='84'?h='48'?color='gray'??stroke='7'?/>
????
????<fillArc?x='32'?y='124'?w='130'?h='170'?start='0'?end='190'?color='red'??/>
????<fillArc?id='fa1'?x='200'?y='300'?w='40'?h='20'?start='0'?end='300'?color='red'??/>
????<polygon?xs='32,80,23,7,64'?ys='124,2,42,24,6'?color='darkolivegreen'??/>
????<polygon?id='pp1'?xs='32,4,2'?ys='124,3,51'?color='darkolivegreen'??/>
????<fillPolygon?xs='10,85,93,60'?ys='50,10,105,87'?color='00aaaa'??/>
????<fillPolygon?id='adfh'??xs='80,126,-30,-60'?ys='0,130,40,100'?color='00aaaa'??/>
????
????<image?x='200'?y='300'?w='50'?h='50'?url='../image/test.bmp'?/>
????<image?id='ima'?x='300'?y='300'?w='50'?h='50'?url='../image/test.bmp'?/>
????<string??font='arial'??size='15'?style='Font.ITALIC_BOLD'?str='劉凱毅'?x='300'?y='400'?color='red'?/>
????<string?id='strr'??font='arial'??size='20'?style='Font.ITALIC_BOLD'?str='萬歲'?x='310'?y='420'??/>
</grabhics>
簡單頁面 : 給出 div 的 id (位置 和 xml 的出處 就可以了)load() 方法
<!DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.01//ZH-CN"?"http://www.w3.org/TR/html4/strict.dtd">
<html>
????<head>
????????<meta?http-equiv="Content-Type"?content="text/html;?charset=UTF-8"?/>
????????<script?language="JavaScript"?src='../lib/prototype/wz_jsgraphics.js'?></script>
????????<script?language="JavaScript"?src="../lib/prototype/prototype.js"></script>
????????<script?language="JavaScript"?src="../js/test.js"?></script>
????????<script?language="JavaScript"?src="../js/Xmlgraphics.js"?></script>
????????
????</head>
????
?<body?onload='load(?"http://127.0.0.1:8000/Mywz_jsgraphics/xml/graphics.xml"?)'>?????
???<div?id="myCanvas"?style="position:relative;height:250px;width:100%;">?<input?type='button'?onclick='tt()'?/>?</div>?
?</body>
</html>
<script>
????function?tt(){
????????var?uu?=?'strr'
?????????var?g2?=?getGdom(uu)?;
????????getValue(uu).clear();
??
????}
????
</script>