首页 > 代码库 > 山寨美化图片滤镜

山寨美化图片滤镜

效果:

  

新浪微博,美图秀秀还有其他的那些都是把滤镜的swf编译进了他的flex里面,不好取出,只有qq空间的是按需加载,点击一个滤镜,加载一个滤镜swf,所以qq空间,对不起了。。。

1.获取滤镜的swf,去qq空间的美化图片,点击一个滤镜,用firebug之类的得到滤镜,最后得到的滤镜:

"abao.swf","colorfulmood.swf","enhance.swf","lordkelvin.swf","blackenhance.swf","sweetjelly.swf","lightred.swf","aladin.swf","mellow.swf","rainbow.swf","romanticstar.swf","smokedval.swf","sweetlight.swf","sweet.swf","nashville.swf","lomored.swf"

对应的滤镜名称:

"阿宝色","缤纷心情","自动增强","枫叶","黑白画映","琥珀","亮红","潘多拉","午茶","彩虹","浪漫星光","掠影","甜美光影","甜美可人","往昔","晚秋"

 

2.用Loader类加载滤镜swf,对swf的content var a:BitmapData =http://www.mamicode.com/content.execute(bmpData);bmpData 是目标图片的bitmapdata..那个execute方法是接口暴露出来渲染滤镜效果的方法,,qq空间美化图片里面美化和磨皮的swf也是用的类似方法。

其他都是些小细节,很简单的。

山寨美化图片滤镜