flash as3: copyChannel

[ 2010-08-19 11:09:23 | Author: liuhuan ]
Font Size: Large | Medium | Small
uploads/201008/19_110901_tt.jpg

var bmp:BitmapData = new BitmapData(mOriginal.width, mOriginal.height, true);
bmp.draw(mOriginal);
var b = new BitmapData(mOriginal.width, mOriginal.height, true, 0xff000000);
var r = new BitmapData(mOriginal.width, mOriginal.height, true, 0xff000000);
var g = new BitmapData(mOriginal.width, mOriginal.height, true, 0xff000000 );
b.copyChannel(bmp, new Rectangle(0, 0, mOriginal.width, mOriginal.height), new Point(0, 0), BitmapDataChannel.BLUE, BitmapDataChannel.BLUE);
r.copyChannel(bmp, new Rectangle(0, 0, mOriginal.width, mOriginal.height), new Point(0,0), BitmapDataChannel.RED, BitmapDataChannel.RED);
g.copyChannel(bmp, new Rectangle(0, 0, mOriginal.width, mOriginal.height), new Point(0,0), BitmapDataChannel.GREEN, BitmapDataChannel.GREEN);
var bm_b:Bitmap = new Bitmap(b);
var bm_r:Bitmap = new Bitmap(r);
var bm_g:Bitmap = new Bitmap(g);
var holder:MovieClip = new MovieClip();
holder.addChild(bm_b);
holder.addChild(bm_r);
holder.addChild(bm_g);
bm_r.x = 0;
bm_g.x = mOriginal.width;
bm_b.x = mOriginal.width*2;
this.addChild(holder);
holder.x = mOriginal.width;
Comments Feed Comments Feed: http://www.liuhuan.com/blog/feed.asp?q=comment&id=1085

There is no comment on this article.

You can't post comment on this article.