大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> Script -> 利用Wipe等ActiveX技术,实现n(n>>2)幅图片轮换擦洗显示

利用Wipe等ActiveX技术,实现n(n>>2)幅图片轮换擦洗显示

时间: 2021-07-31 作者:daque

 普遍的做法,只能表露两张图片,由于wipe擦洗本领控制只能两张图片间切换。 但不妨经过将两张图片转为动画瓜代表露

<script> var i=0,pictures=new array();//树立图片数组var picbase=""; //树立图片地方目次pictures[i++]="1.gif" pictures[i++]="2.gif" pictures[i++]="3.gif" pictures[i++]="4.gif" pictures[i++]="5.gif" pictures[i++]="6.gif" pictures[i++]="7.gif" pictures[i++]="8.gif" pictures[i++]="9.gif" pictures[i++]="10.gif" pictures[i++]="11.gif" pictures[i++]="12.gif" pictures[i++]="13.gif" pictures[i++]="14.gif" pictures[i++]="15.gif" pictures[i++]="16.gif" pictures[i++]="17.gif" pictures[i++]="18.gif" pictures[i++]="19.gif" pictures[i++]="20.gif" pictures[i++]="21.gif" pictures[i++]="22.gif" var picturewidth=400//图片宽窄 var pictureheight=290//图片莫大 var delay=1//推迟功夫 </script> <script> if (document.all) { document.write('<object id="dacontrol_wipe" ') document.write('style="width:'+picturewidth+';height:'+pictureheight+'"') document.write('classid="clsid:b6ffc24c-7e13-11d0-9b47-00c04fc2f51d">') document.write('</object>') m = dacontrol_wipe.meterlibrary; whattransformation = new activexobject("dximagetransform.microsoft.wipe"); whattransformation.gradientsize = 1.0;//树立突变度 whattransformation.wipestyle = 0;//树立擦洗典型 var myarr=new array(),myarr2=new array(); var len=math.floor(pictures.length/2);//将图片分红两组 for(var i=0;i<len;i++){ myarr[i]=m.importimage(picbase+pictures[2*i]) myarr2[i]=m.importimage(picbase+pictures[2*i+1]) } if(pictures[2*i]) myarr[i]=m.importimage(picbase+pictures[2*i]) else myarr[i]=m.importimage(picbase+pictures[0]) ; myarr=m.array(myarr) myarr2=m.array(myarr2) index = m.interpolate(0.5,len+0.5,len*2*delay).repeatforever(); index2 = m.interpolate(0,len,len*2*delay).repeatforever(); //交叉运转半个功夫单位 var whatpictures=new array(); whatpictures[0] = myarr.nthanim(index); whatpictures[1] = myarr2.nthanim(index2); forward = m.interpolate(0, 1, delay); back = m.interpolate(1, 0, delay); whatmovement = m.sequence(forward, back).repeatforever(); //树立参数目标 theresult = m.applydxtransform( whattransformation, whatpictures, whatmovement ); dacontrol_wipe.image = theresult.outputbvr;//树立表露图形 dacontrol_wipe.start();//发端 } </script>

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.