手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网页制作>Flash>列表

Flash实现模拟吸管Eyedropper功能动画

来源:互联网 作者:west263.com 时间:2008-04-02
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

  c续之前的柔化后觉得BitmapData函数做到了很多之前做不到的效果了,尤其是在制作画板时需要的吸管工具,在这里只要一行函数就能够取得我们要的?色了。。真方便啊

  


  
MovieClip.prototype.smoothImageLoad=function(img){//柔化?片

  varm=this.createEmptyMovieClip("mc",this.getNextHighestDepth());

  varlistener=newMovieClipLoader();

  listener.onLoadComplete=function(mc:MovieClip){

  mc.onEnterFrame=function(){

  varbitmap=newflash.display.BitmapData(this._width,this._height);

  bitmap.draw(this);

  this.attachBitmap(bitmap,1,true,true);

  this.smoothImageLoadComplete();

  updateAfterEvent();

  }

  };

  listener.loadClip(img,m);

  };

  MovieClip.prototype.pickColor=function(){//取得?片?色

  varbitmap=newflash.display.BitmapData(this._width,this._height);

  bitmap.draw(this);

  if(bitmap!=undefined){

  varmyColor=bitmap.getPixel(this._xmouse,this._ymouse);

  return"0x" myColor.toString(16).toUpperCase();

  }

  }

  this.createEmptyMovieClip("mc",0);

  mc.smoothImageLoad("doggy.jpg");

  mc._xscale=mc._yscale=300;

  this.onMouseMove=function(){

  myColor=mc.pickColor();//取得?片的?色函?

  varcolorTansform=newflash.geom.ColorTransform();

  colorTansform.rgb=myColor;

  colorMc.transform.colorTransform=colorTansform;

  colorTxt.text=myColor;

  updateAfterEvent();

  }


文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!