Vml图像画板

  1. <HTML xmlns:v>   
  2. <HEAD>   
  3. <META http-equiv="Content-Type" content="text/html; Charset=gb2312">   
  4. <META NAME="KEYWORDS" CONTENT="Vml图像画板">   
  5. <title>蓝丽网 - Vml图像画板.2003-www.51windows.Net</title>   
  6. <STYLE>   
  7. v\:*{behavior:url(#default#VML);}   /*声明V为VML变量*/  
  8. a{text-Decoration:none;color:white}   
  9. a:hover{text-Decoration:underline;color:yellow;}   
  10. td{font-size:12px;color:white}   
  11. .bon1{border-bottom:1 solid eeeeee;border-right:1 solid eeeeee;border-left:1 solid gray;border-top:1 solid gray;background-color:#619CE7;color:yellow;width:54}   
  12. .bon2{border-bottom:1 solid gray;border-right:1 solid gray;border-left:1 solid eeeeee;border-top:1 solid eeeeee;background-color:#619CE7;color:white;width:54}   
  13. </STYLE>   
  14. </HEAD>   
  15. <BODY oncontextmenu='return false' style='margin:1;cursor:default' vlink=#3732CD link='#3732CD' onselectstart='if(event.srcElement.tagName!="TEXTAREA"&&event.srcElement.tagName!="INPUT")return false'>   
  16. <v:Line style='position:absolute;z-index:2000;display:none' id='line1'>  <!--钢笔可视化-->   
  17. <v:Stroke dashstyle='shortdash'/>   
  18. </v:line>   
  19. <v:Oval style='position:absolute;z-index:2000;display:none' id='oval1'>  <!--圆形可视化-->   
  20. <v:Stroke dashstyle='shortdash'/>   
  21. </v:oval>   
  22. <v:rect style='position:absolute;z-index:2000;display:none' id='rect1'>  <!--长方形可视化-->   
  23. <v:Stroke dashstyle='shortdash'/>   
  24. </v:rect>   
  25. <v:roundrect style='position:absolute;z-index:2000;display:none' id='roundrect1'>  <!--圆锯形可视化-->   
  26. <v:Stroke dashstyle='shortdash'/>   
  27. </v:roundrect>   
  28. <span style='position:absolute;z-index:2000;display:none' id='wenzi1'>   <!--插入文字可视化-->   
  29. <textarea id='txt1' style='border:1 solid black;width:200;height:50'></textarea><br>   
  30. <center><input type='button' value='插入' class="bon2" onclick="charuwenzi()">   
  31. </span>   
  32. <span style='position:absolute;z-index:2000;display:none' id='tupian1'>   <!--插入图片可视化-->   
  33. <input type='file' id='file1' style='width:200'><br>   
  34. <center><input type='button' value='插入' class="bon2" onclick="charutupian()">   
  35. </span>   
  36. <span style='position:absolute;z-index:2000;display:none' id='gaoji1'>   <!--高级改可视化-->   
  37. <textarea id='txt2' style='border:1 solid black;width:400;height:150'></textarea><br>   
  38. <center><input type='button' value='修改' class="bon2" onclick="gaojiobj.outerHTML=txt2.value;gaojiobj=null;gaoji1.style.display='none'">   
  39. </span>   
  40. <span style='position:absolute;z-index:2000;display:none' id='yuandaima'>   <!--所有原代码-->   
  41. <textarea id='txt3' style='border:1 solid black;width:600;height:400'></textarea><br>   
  42. <center><input type='button' value='复制' class="bon2" onclick="window.clipboardData.setData('text',txt3.value);alert('已将数据复制到系统剪切板')"> <input type='button' value='更新修改' class="bon2" onclick="div1.innerHTML=txt3.value;yuandaima.style.display='none'"> <input type='button' value='取消' class="bon2" onclick="yuandaima.style.display='none'">   
  43. </span>   
  44. <span style='position:absolute;z-index:2000;display:none' id='menu1'>    <!--弹出菜单-->   
  45. <input type=button class=bon2 value=置前 onclick='zz+=1;thisobj.style.zIndex=zz;menu1.style.display="none"'><br>   
  46. <input type=button class=bon2 value=置后 onclick='zz2-=1;thisobj.style.zIndex=zz2;menu1.style.display="none"'><br>   
  47. <input type=button class=bon2 value=复制 onclick='div1.innerHTML+=thisobj.outerHTML;alert("复制完成,请使用选移功能拖动");menu1.style.display="none"'><br>   
  48. <input type=button class=bon2 value=删除 onclick='thisobj.outerHTML="";menu1.style.display="none"'><br>   
  49. </span>   
  50. <iframe id=web src="about:blank" style="display:none"></iframe>  <!--实现保存-->   
  51. <span style='position:absolute;z-index:2000;display:none' id='help'>   <!--帮助信息-->   
  52. <textarea readonly='true' style='border:1 solid black;width:500;height:300'>   
  53. VML图像画板.2003(操作帮助及功能简介)   
  54.   
  55. 目前最强的网页VML(网页矢量图形标记语言)编辑工具之一,VML学习者的最佳学习工具   
  56. 能够完成基本的三维网页的设计,做图及图形处理功能一般(原作者今后有时间会去强化)   
  57. 基本的画笔及图形处理工具在右方,点选后在画板内使用鼠标左键应用   
  58. 可将画板内VML代码图形保存为文件,亦可通过“修改原代码”实现“打开文件”等功能   
  59. 文字:该功能暂未提供可视化的修改编辑功能,但代码为HTML相对比较简单   
  60. 图片:支持FILE:///及HTTP://两种协议类型,矢量化后失真现象很少   
  61. 记忆点:该功能只有在点击后大于点击时X,Y的坐标,才能看到效果,今后也许原作者会找到好的解决方法   
  62. 填充:该功能只有“钢笔”所划的线无法使用   
  63. 边框:该功能的“起点尖头”“终点尖头”只对“钢笔”“记忆点”所画的图形有效   
  64. 保存为文件:在弹出保存对话框时,在对话框中“语言”下拉菜单中选择“Unicode”保存后能够正常显示   
  65. 关于打开文件的功能:由于客户端资源及文件编码类型问题,该功能先已“修改原代码”代替,可直接将已保存的VML输入后点击“更新修改”即可虚拟完成已有文件的打开   
  66.   
  67. VML图像画板.2003(版权信息)   
  68.   
  69. 原作者:风云舞   
  70. 主  页:http://www.lshdic.com   
  71. 最新版:可登陆主页查看   
  72. 发布于:2003825日   
  73. 授  权:授权给任何个人使用、应用,自由DHTML代码,可任意修改学习、转载、强化,作者制作本作品出发点是为了提高用户的VML编程水准、开拓一个先例,因而未加密及方便参考仅采用一页代码,为此,未经原作者同意请不要将VML图像画板任何版本用于其他商业用途,侵我版权毁我及作品名声,公开于网站、软件发布及其他应用请保留原作者的这些声明(但可以追加其他信息,如修改者各项授权信息等)   
  74. </textarea><br>   
  75. <center><input type='button' value='关闭帮助' class="bon2" onclick="help.style.display='none'">   
  76. </span>   
  77. <TABLE cellspacing=0 cellpadding=3 width=770 align=center bgcolor='#619CE7' style='border-right:3 dashed green;border-left:3 dashed #4735B0;border-top:1 solid blue;border-bottom:gray' id=allform1>   
  78. <tr align=center onmouseover='if(event.srcElement.tagName=="TD"&&event.srcElement.width==70)event.srcElement.bgColor="aaaaaa"' onmouseout='if(event.srcElement.tagName=="TD")event.srcElement.bgColor=""' style='cursor:hand'><td width=70 id=toptd1 onclick="yuandaima.x=event.x;yuandaima.y=event.y;txt3.value=div1.innerHTML.replace(/>/g,'>\n').replace(/ = /g,'=').replace(/\: /g,':').replace(/\; /g,';');yuandaima.style.display=''">   
  79. 修改原代码</td><td width=70 onclick="web.document.write('<HTML xmlns:v>\n<HEAD>\n<META http-equiv=Content-Type content=text/html;charset=gb2312>\n<TITLE>我的杰作-www.51windows.Net</TITLE>\n<META name=Gemeratpr content=蓝丽VML图形编辑器>\n<META name=GemeratprHomePage content=http://www.lshdic.com>\n<STYLE>\nv\\:*{behavior:url(#default#VML);}\n</STYLE>\n</HEAD>\n<BODY>\n'+div1.innerHTML+'\n</BODY>\n</HTML>');web.document.execCommand('SaveAs',false,'我的杰作')">保存为文件</td><td width=70 onclick="if(this.innerText=='最大化视图'){div1.style.width=document.body.offsetWidth-150;div1.style.height=document.body.offsetHeight-35;this.innerText='恢复视图'}else{div1.style.width=650;div1.style.height='100%';this.innerText='最大化视图'}">最大化视图</td><td width=70 onclick="help.x=event.x;help.y=event.y;help.style.display=''">操作帮助</td><td width=60>&nbsp;</td><td width=60>&nbsp;</td><td align=right>原作:风云舞,蓝丽程序员网络:<a href='http://www.lshdic.com' target='_blank'>http://www.lshdic.com</a>   
  80. </td></tr><tr>   
  81. <td width=100% colspan=10 height=500>   
  82. <table cellspacing=0 cellpadding=0 height=100%%><tr><td width=660>   
  83.   
  84. <div style='width:650;height:100%;background-color:white;border:1 solid gray;color:black;' id=div1></div>   
  85. </td><td>   
  86. <div style='width:110;height:100%;'>   
  87. <center><b>画笔选择</b><br>   
  88. <button class=bon2 id=huabi>选移<button class=bon2 id=huabi>调大小<button class=bon2 id=huabi>扔出</button><button class=bon1 id=huabi>钢笔</button><button class=bon2 id=huabi>记忆点<button class=bon2 id=huabi>圆型<button class=bon2 id=huabi>长方型<button class=bon2 id=huabi>圆矩型<button class=bon2 id=huabi>文字<button class=bon2 id=huabi>图片<button class=bon2 id=huabi>填充<button class=bon2 id=huabi>立体<button class=bon2 id=huabi>边框<button class=bon2 id=huabi>高级</button><br2>   
  89. <b>画笔基本参数</b><br>   
  90. 笔边粗度 <select style="width:54;" id=bibiancudu><option selected>1<script>for(i=2;i<101;i++)document.write("<option>"+i)</script></select><br>   
  91. 画笔颜色 <input style='border:1 solid black;width:54;height:17;' value='#000000' id=huabiyanse onmousedown='colortab.style.left=event.x-50;colortab.style.top=event.y+this.offsetHeight;rndcolor(this.id)'><br>   
  92. 画笔背景 <input style='border:1 solid black;width:54;height:17;' value='#FFFFFF' id=huabibeijing onmousedown='colortab.style.left=event.x-50;colortab.style.top=event.y+this.offsetHeight;rndcolor(this.id)'><br>   
  93. X Y 坐标 <input disabled='true' type='text' value='0,0' id='zuobiao' style='border:1 solid black;width:54;height:17;'><br>   
  94. <span id=tianchong1 style='display:none'>   
  95. <b>&nbsp;<br>填充基本参数</b><br>   
  96. 普通背景 <input style='border:1 solid black;width:54;height:17;' value='' id=tianchongbeijing onmousedown='colortab.style.left=event.x-50;colortab.style.top=event.y+this.offsetHeight;rndcolor(this.id)'><br>使用渐变背景<input type='checkbox' id='usejianbian'><br>   
  97. 渐变色一 <input style='border:1 solid black;width:54;height:17;color:red' value='#FF0000' id=jianbianse1 onmousedown='colortab.style.left=event.x-50;colortab.style.top=event.y+this.offsetHeight;rndcolor(this.id)'>   
  98. <br>渐变色二 <input style='border:1 solid black;width:54;height:17;' value='#FFFFFF' id=jianbianse2 onmousedown='colortab.style.left=event.x-50;colortab.style.top=event.y+this.offsetHeight;rndcolor(this.id)'><br>   
  99. 上下渐变 <input type=radio name='jianbianyangshi' checked><br>   
  100. 斜向渐变 <input type=radio name='jianbianyangshi'>   
  101. </span>   
  102. <span id=liti1 style='display:none'>   
  103. <b>&nbsp;<br>立体基本参数</b><br>   
  104. 后向伸展 <select style="width:54;" id=houxiangshenzhan><option selected>20<script>for(i=0;i<101;i++)document.write("<option>"+i)</script></select><br>   
  105. <br>前向伸展 <select style="width:54;" id=qianxiangshenzhan><option selected>0<script>for(i=1;i<101;i++)document.write("<option>"+i)</script></select><br>   
  106. 偏移左边 <select style="width:54;" id=pianyizuobian><option selected>0<script>for(i=1;i<101;i++)document.write("<option>"+i)</script></select><br>   
  107. 偏移上边 <select style="width:54;" id=pianyishangbian><option selected>0<script>for(i=1;i<101;i++)document.write("<option>"+i)</script></select><br>   
  108. 立体颜色 <input style='border:1 solid black;width:54;height:17;' value='' id=litiyanse  onmousedown='colortab.style.left=event.x-50;colortab.style.top=event.y+this.offsetHeight;rndcolor(this.id)'><br>   
  109. </span>   
  110. <span id=biankuang1 style='display:none'>   
  111. <b>&nbsp;<br>边框基本参数</b><br>   
  112. 边框粗度 <select style="width:54;" id=biankuangcudu><option selected>1<script>for(i=0;i<101;i++)document.write("<option>"+i)</script></select><br>   
  113. <br>边框样式 <select style="width:54;" id=biankuangyangshi><option selected>none<option>dash<option>dashdot<option>dot<option>longdash<option>longdashdot<option>shortdash<option>shortdashdot<option>shortdashdotdot<option>longdashdotdot<option>shortdot</select><br>   
  114. 起点尖头 <select style="width:54;" id=qidianjiantou><option selected>none<option>block<option>classic<option>diamond<option>open<option>oval</select><br>   
  115. 终点尖头 <select style="width:54;" id=zhongdianjiantou><option selected>none<option>block<option>classic<option>diamond<option>open<option>oval</select><br>   
  116. 边框颜色 <input style='border:1 solid black;width:54;height:17;' value='' id=biankuangyanse   onmousedown='colortab.style.left=event.x-50;colortab.style.top=event.y+this.offsetHeight;rndcolor(this.id)'><br>   
  117. </span>   
  118. </div>   
  119. </td></tr></table>   
  120. </td></tr>   
  121. </table>   
  122. <table cellspacing=0 cellpadding=0 style='position:absolute;width:100;height:100;display:none;background-color:red' id='colortab'><tr><td id='colorid'></td></tr></table>   
  123. <script language='jscript'>   
  124. var bi=4    //定义当前使用的画笔工具,3为铅笔   
  125. var color1='#000000',color2='#000000',size1=0  //定义缺剩的画笔颜色及画笔填充颜色和笔边粗度   
  126. var xx=0,yy=0,zz=1000  //定义缺剩的X及Y坐标   
  127. var isok=false  //区分画笔起点是否在DIV内,超出范围则无效   
  128. var moveobj=null,ckleft=0,cktop=0,ckwid=0,ckhei=0,ckto=""  //被移动物件、调整大小物件的引用   
  129. var poly1=null,oldvalue="",oldx=0,oldy=0  //为了完成记忆点,创建一个可折式线段   
  130. var gaojiobj=null  //为了完成“高级”功能,绑定被修改对象   
  131. var thisobj=null   //为了完成各种基本编辑功能,如“置前”“复制”“删除”等   
  132. var zz2=1000          //为完成“置后”功能,zz2为负数   
  133. function div1.onmousedown(){   
  134. div1.setCapture();color1=huabiyanse.value;color2=huabibeijing.value;isok=true;size1=bibiancudu.options[bibiancudu.selectedIndex].text   
  135. xx=event.x;yy=event.y;zz+=1  
  136. for(i=0;i<huabi.length;i++){if(huabi[i].className=="bon1"){bi=i+1;break}}   
  137. line1.strokecolor=color1;line1.strokeweight=size1;oval1.strokeweight=size1;oval1.strokecolor=color1   
  138. oval1.fillcolor=color2;rect1.strokeweight=size1;rect1.strokecolor=color1   
  139. rect1.fillcolor=color2;roundrect1.strokeweight=size1;roundrect1.strokecolor=color1   
  140. roundrect1.fillcolor=color2;   
  141. if(event.button==1){   
  142. switch(bi){   
  143. case 1:  //选移   
  144. if(event.srcElement.parentElement.id=="div1"){moveobj=event.srcElement;ckleft=xx-parseInt(moveobj.style.left);cktop=yy-parseInt(moveobj.style.top)}   
  145. break;   
  146. case 2:  //调大小   
  147. if(event.srcElement.parentElement.id=="div1"){moveobj=event.srcElement;   
  148. ckleft=parseInt(moveobj.style.left);cktop=parseInt(moveobj.style.top);ckwid=moveobj.offsetWidth;ckhei=moveobj.offsetHeight}   
  149. break;   
  150. case 3:  //扔出   
  151. break;   
  152. case 4:  //钢笔   
  153. line1.style.left=event.x;line1.style.top=event.y;line1.to="0,0";line1.style.display=""  
  154. break;   
  155. case 5:  //记忆点   
  156. if(poly1==null){   
  157. oldx=xx;oldy=yy   
  158. poly1=div1.appendChild(document.createElement("<v:polyline points='0 0 0 0' style='position:absolute;z-index:"+zz+";left:"+xx+";top:"+yy+";' strokecolor='"+color1+"' strokeweight='"+size1+"' fillcolor='"+color2+"'/>"))   
  159. }   
  160. if(oldx-tempx<1&&oldy-tempy<1)oldvalue=poly1.points.value.replace(/,/g,' ')   
  161. break;   
  162. case 6:  //圆形   
  163. oval1.style.left=event.x;oval1.style.top=event.y;oval1.style.width=0;oval1.style.height=0;oval1.style.display=""  
  164. break;   
  165. case 7:  //长方形   
  166. rect1.style.left=event.x;rect1.style.top=event.y;rect1.style.width=0;rect1.style.height=0;rect1.style.display=""  
  167. break;   
  168. case 8:  //圆矩形   
  169. roundrect1.style.left=event.x;roundrect1.style.top=event.y;roundrect1.style.width=0;roundrect1.style.height=0;roundrect1.style.display=""  
  170. break;   
  171. case 9:  //文字   
  172. wenzi1.style.left=event.x;wenzi1.style.top=event.y;wenzi1.style.display=""  
  173. break;   
  174. case 10:  //图片   
  175. tupian1.style.left=event.x;tupian1.style.top=event.y;tupian1.style.display=""  
  176. break;   
  177. }   
  178. }}   
  179. function div1.onmousemove(){   
  180. tempx=event.x;tempy=event.y;temp1=0;temp2=0  
  181. zuobiao.value=tempx-allform1.offsetLeft-8+","+parseInt(tempy-toptd1.offsetHeight-7)   
  182. if(bi==5&&poly1!=null){   //记忆点   
  183. if(oldx-tempx<0&&oldy-tempy<0)poly1.points.value=oldvalue+" "+(tempx-oldx)+" "+(tempy-oldy)   
  184. }   
  185. if(event.button==1){   
  186. switch(bi){   
  187. case 1:  //选移   
  188. if(moveobj!=null){moveobj.style.left=tempx-ckleft;moveobj.style.top=tempy-cktop}   
  189. break;   
  190. case 2:  //调大小   
  191. if(moveobj!=null){   
  192. if(moveobj.tagName!="line"){   
  193. if(tempx>ckleft){moveobj.style.width=tempx-ckleft}else{moveobj.style.left=tempx;moveobj.style.width=ckleft-tempx}   
  194. if(tempy>cktop){moveobj.style.height=tempy-cktop}else{moveobj.style.top=tempy;moveobj.style.height=cktop-tempy}   
  195. }else{moveobj.to=parseInt(tempx-ckleft)+","+parseInt(tempy-cktop);if(ckto=="")ckto=parseInt(tempx-ckleft)+","+parseInt(tempy-cktop);}   
  196. }   
  197. break;   
  198. case 4:  //钢笔   
  199. line1.to=(tempx-xx)+","+(tempy-yy)   
  200. break;   
  201. case 6:  //圆形   
  202. if(tempx-xx<0){oval1.style.left=event.x;oval1.style.width=(xx-tempx)}else{oval1.style.width=(tempx-xx)}   
  203. if(tempy-yy<0){oval1.style.top=event.y;oval1.style.height=(yy-tempy)}else{oval1.style.height=(tempy-yy)}   
  204. break;   
  205. case 7:  //长方形   
  206. if(tempx-xx<0){rect1.style.left=event.x;rect1.style.width=(xx-tempx)}else{rect1.style.width=(tempx-xx)}   
  207. if(tempy-yy<0){rect1.style.top=event.y;rect1.style.height=(yy-tempy)}else{rect1.style.height=(tempy-yy)}   
  208. break;   
  209. case 8:  //圆矩形   
  210. if(tempx-xx<0){roundrect1.style.left=event.x;roundrect1.style.width=(xx-tempx)}else{roundrect1.style.width=(tempx-xx)}   
  211. if(tempy-yy<0){roundrect1.style.top=event.y;roundrect1.style.height=(yy-tempy)}else{roundrect1.style.height=(tempy-yy)}   
  212. break;   
  213. }}}   
  214. function div1.onmouseup(){   
  215. document.releaseCapture();if(isok==false){forerr();return false};isok=false;menu1.style.display='none'   
  216. tempx=event.x;tempy=event.y;divwid=div1.offsetWidth;divhei=div1.offsetHeight   
  217. if(tempx>allform1.offsetLeft+divwid+5||tempx<allform1.offsetLeft+5){forerr();return alert("X坐标越界")}   
  218. if(tempy>allform1.offsetTop+toptd1.offsetHeight+divhei+5||tempy<allform1.offsetTop+toptd1.offsetHeight+5){forerr();return alert("Y坐标越界")}   
  219. if(event.button==2&&bi==5&&poly1!=null){   
  220. poly1.points.value=oldvalue;oldvalue="";poly1=null;   
  221. }else if(event.srcElement.parentElement.id=="div1"&&event.button==2){menu1.style.left=tempx;menu1.style.top=tempy;menu1.style.display='';thisobj=event.srcElement}   
  222. if(event.button==1){   
  223. switch(bi){   
  224. case 1:  //选移   
  225. if(moveobj!=null&&parseInt(moveobj.style.left)<allform1.offsetLeft+5){forerr();return alert("被移动物体X1超出界限")}   
  226. if(moveobj!=null&&parseInt(moveobj.style.left)+moveobj.offsetWidth-2>allform1.offsetLeft+divwid+5){forerr();return alert("被移动物体X2超出界限")}   
  227. if(moveobj!=null&&parseInt(moveobj.style.top)<allform1.offsetTop+toptd1.offsetHeight+5){forerr();return alert("被移动物体Y1超出界限")}   
  228. if(moveobj!=null&&parseInt(moveobj.style.top)+moveobj.offsetHeight-2>allform1.offsetTop+toptd1.offsetHeight+divhei+3){forerr();return alert("被移动物体Y2超出界限")}   
  229. moveobj=null  
  230. break;   
  231. case 2:  //调大小   
  232. moveobj=null;ckto=""  
  233. break;   
  234. case 3:  //仍出   
  235. if(event.srcElement.parentElement.id=="div1")event.srcElement.outerHTML=""  
  236. break;   
  237. case 4:  //钢笔   
  238. div1.appendChild(document.createElement("<v:line style='position:absolute;z-index:"+zz+";left:"+xx+";top:"+yy+";' to='"+(event.x-xx)+","+(event.y-yy)+"' strokecolor='"+color1+"' strokeweight='"+size1+"'/>"))   
  239. line1.style.display="none"  
  240. break;   
  241. case 6:  //圆形   
  242. div1.appendChild(document.createElement("<v:oval style='position:absolute;z-index:"+zz+";left:"+oval1.style.left+";top:"+oval1.style.top+";width:"+oval1.style.width+";height:"+oval1.style.height+";' strokecolor='"+color1+"' strokeweight='"+size1+"' fillcolor='"+color2+"'/>"))   
  243. oval1.style.display="none"  
  244. break;   
  245. case 7:  //长方形   
  246. div1.appendChild(document.createElement("<v:rect style='position:absolute;z-index:"+zz+";left:"+rect1.style.left+";top:"+rect1.style.top+";width:"+rect1.style.width+";height:"+rect1.style.height+";' strokecolor='"+color1+"' strokeweight='"+size1+"' fillcolor='"+color2+"'/>"))   
  247. rect1.style.display="none"  
  248. break;   
  249. case 8:  //圆矩形   
  250. div1.appendChild(document.createElement("<v:roundrect style='position:absolute;z-index:"+zz+";left:"+roundrect1.style.left+";top:"+roundrect1.style.top+";width:"+roundrect1.style.width+";height:"+roundrect1.style.height+";' strokecolor='"+color1+"' strokeweight='"+size1+"' fillcolor='"+color2+"'/>"))   
  251. roundrect1.style.display="none"  
  252. break;   
  253. case 11:  //渐变   
  254. if(event.srcElement.parentElement.id=="div1"){   
  255. if(!usejianbian.checked){event.srcElement.fillcolor=tianchongbeijing.value}else{   
  256. temp1=jianbianyangshi[0].checked?'gradient':'gradientradial'   
  257. temp2=event.srcElement.innerHTML.replace(/<v\:fill .*<\/v:fill>/gi,'')   
  258. event.srcElement.innerHTML=temp2+"<v:fill color='"+jianbianse2.value+"' color2='"+jianbianse1.value+"' type='"+temp1+"'/>"  
  259. }}   
  260. break;   
  261. case 12:  //立体   
  262. if(event.srcElement.parentElement.id=="div1"){   
  263. temp2=event.srcElement.innerHTML.replace(/<v\:extrusion .*<\/v:extrusion>/gi,'')   
  264. event.srcElement.innerHTML=temp2+"<v:Extrusion on='t' color='"+litiyanse.value+"' backdepth='"+houxiangshenzhan.options[houxiangshenzhan.selectedIndex].text+"' foredepth='"+qianxiangshenzhan.options[qianxiangshenzhan.selectedIndex].text+"' rotationangle='"+pianyishangbian.options[pianyishangbian.selectedIndex].text+","+pianyizuobian.options[pianyizuobian.selectedIndex].text+"'/>"  
  265. }   
  266. break;   
  267. case 13:  //边框   
  268. if(event.srcElement.parentElement.id=="div1"){   
  269. temp2=event.srcElement.innerHTML.replace(/<v\:stroke .*<\/v:stroke>/gi,'')   
  270. event.srcElement.innerHTML=temp2+"<v:Stroke dashstyle='"+biankuangyangshi.options[biankuangyangshi.selectedIndex].text+"' startarrow='"+qidianjiantou.options[qidianjiantou.selectedIndex].text+"' endarrow='"+zhongdianjiantou.options[zhongdianjiantou.selectedIndex].text+"'/>"  
  271. event.srcElement.strokecolor=biankuangyanse.value   
  272. biankuangcudu.options[biankuangcudu.selectedIndex].text=='0'?event.srcElement.stroked=false:event.srcElement.strokeweight=biankuangcudu.options[biankuangcudu.selectedIndex].text   
  273. }   
  274. break;   
  275. case 14:  //高级   
  276. if(event.srcElement.parentElement.id=="div1"){   
  277. gaojiobj=event.srcElement   
  278. txt2.value=event.srcElement.outerHTML.replace(/>/g,">\n").replace(/ = /g,"=").replace(/\: /g,":").replace(/\; /g,";");gaoji1.style.left=event.x;gaoji1.style.top=event.y;gaoji1.style.display=''  
  279. }   
  280. }}}   
  281. function rndcolor(theobjis){   
  282. colortab.style.display="";colorid.innerHTML="";str1="<table cellspacing=0 cellpadding=0>";   
  283. for(r=0;r<10;r++){str1+="<tr>"  
  284. for(i=0;i<10;i++){   
  285. tempcolor1=Math.round(Math.random()*255).toString(16)+Math.round(Math.random()*255).toString(16)+Math.round(Math.random()*255).toString(16);while(tempcolor1.length<6){tempcolor1+=Math.round(Math.random()*9)}   
  286. str1+="<td style='width:10;height:10;background-color:#"+tempcolor1+";' onclick="+theobjis+".value='#"+tempcolor1+"';"+theobjis+".style.color='#"+tempcolor1+"';colortab.style.display='none'></td>"  
  287. }str1+="</tr>"}   
  288. colorid.innerHTML=str1+"</table>"  
  289. }   
  290. function document.onmouseup(){   
  291. if(event.srcElement.tagName=="BUTTON"){   
  292. event.srcElement.blur();div1.focus();if(event.srcElement.className=="bon1"||event.button!=1)return true;   
  293. for(i=0;i<huabi.length;i++)huabi[i].className="bon2"  
  294. event.srcElement.className="bon1";   
  295. if(huabi[10].className=="bon1"){tianchong1.style.display='';tianchongbeijing.value=tianchongbeijing.value==''?huabibeijing.value:tianchongbeijing.value}else{tianchong1.style.display='none';}   
  296. if(huabi[11].className=="bon1"){liti1.style.display='';litiyanse.value=litiyanse.value==''?huabibeijing.value:litiyanse.value}else{liti1.style.display='none';}   
  297. if(huabi[12].className=="bon1"){biankuang1.style.display='';biankuangyanse.value=biankuangyanse.value==''?huabiyanse.value:biankuangyanse.value}else{biankuang1.style.display='none';}   
  298. if(poly1!=null){   //清除记忆点   
  299. poly1.points.value=oldvalue;oldvalue="";poly1=null;   
  300. };wenzi1.style.display='none';tupian1.style.display='none';gaoji1.style.display='none';menu1.style.display='none'   
  301. }}   
  302. function forerr(){   
  303. if(moveobj!=null&&bi==1){moveobj.style.left=xx-ckleft;moveobj.style.top=yy-cktop;ckleft=0;cktop=0;moveobj=null}   
  304. if(moveobj!=null&&bi==2){   
  305. if(moveobj.tagName!="line"){moveobj.style.left=ckleft;moveobj.style.top=cktop;moveobj.style.width=ckwid;moveobj.style.height=ckhei;}else{moveobj.to=ckto;}   
  306. ckleft=0;cktop=0;ckwid=0;ckhei=0;ckto="";moveobj=null  
  307. }   
  308. line1.style.display='none';oval1.style.display='none';rect1.style.display='none';roundrect1.style.display='none'   
  309. }   
  310. function charuwenzi(){   //插入文字   
  311. if(txt1.value=="")return alert('请先输入文字,在点击插入')   
  312. var newtxt=document.createElement("<span style='position:absolute;z-index:"+zz+";left:"+xx+";top:"+yy+";color:"+color1+";'></span>");newtxt.innerText=txt1.value   
  313. div1.appendChild(newtxt);wenzi1.style.display='none'   
  314. }   
  315. function charutupian(){   //插入图片   
  316. if(file1.value=="")return alert('请先输入图片路径(HTTP://或FILE:///)格式,在点击插入')   
  317. if(file1.value.indexOf("'")>-1)return alert("图片地址不可以含有违禁字符 ' 单引号")   
  318. var newtxt=document.createElement("<v:Image style='position:absolute;z-index:"+zz+";left:"+xx+";top:"+yy+";width:100;height:100' src='"+file1.value+"'/>");   
  319. div1.appendChild(newtxt);tupian1.style.display='none'   
  320. }   
  321. </script>   
  1. da shang
    donate-alipay
               donate-weixin weixinpay

发表评论↓↓