参考网址 http://arahaya.com/canvasscript3/tests/bitmapdata_merge.html
var bitmapData:BitmapData = new BitmapData(component.width,component.height+30, true, 0x0); var matrix:Matrix = new Matrix(); matrix.translate(0,30); //位图平移 bitmapData.draw(component,matrix); var bitmapData2:BitmapData = new BitmapData(component.width, component.height+30, true, 0x0); bitmapData2.draw(component); //位图合并 0x80 表示两张图片各取一半 bitmapData2.merge(bitmapData, new Rectangle(0, 0, component.width, component.height+30), new Point(0, 0), 0x80, 0x80, 0x80, 0x80); //bitmapData2.draw(bitmapData); var image:Image = new Image(); image.source = new Bitmap(bitmapData);
本文介绍了一种使用ActionScript实现的位图合并方法。通过创建两个BitmapData实例,并使用merge方法将两张图片进行融合,其中参数0x80表示取两张图片各一半像素进行混合。此方法适用于动态图像处理及游戏开发中。
897

被折叠的 条评论
为什么被折叠?



