【发布时间】:2010-03-13 19:38:32
【问题描述】:
我正在编写一个MovieClip rasterizer,它对指定movieclip 中的所有帧进行光栅化。这是光栅化的代码:
for ( var i:int = start; i <= end; i++ )
{
//goto the next frame
clip.gotoAndStop( i );
//获取边界 bounds = clip.getBounds(clip);
//创建一个新的位图数据容器 位图数据 = 新位图数据( 变压器宽度 == -1 ? bounds.width:transformer.width, 变压器.高度 == -1 ? bounds.height :transformer.height, 变压器.透明的, 变压器.color );
if (transformer.matrix.tx == 0 && transformer.matrix.ty == 0)transformer.translateToZero(bounds);
//用转换器绘制位图数据 位图数据.draw( this._source, 变压器.矩阵, 变压器.colorTransform, 变压器.blendMode, transformer.clipRect, //new Rectangle(0, 0, bounds.width, bounds.height), 变压器平滑 );
//将数据推入数组 帧.push(位图数据); }
现在结果不同了 - http://i42.tinypic.com/lfv52.jpg - 黑色的是光栅化版本(我在它上面使用了颜色变换来测试它:P)。注意头部和左鞋。任何人都知道问题是什么?我见过人们在 BitmapData 构造函数中向边界框添加“额外”像素,但这是正确的解决方案。
有人知道如何很好地融入角色吗?
【问题讨论】:
标签: actionscript-3 bitmapdata rasterizing