指定されたムービークリップのすべてのフレームをラスタライズする MovieClip ラスタライザを作成しています。ラスタライズのコードは次のとおりです。
for ( var i:int = start; i <= end; i++ )
{
//goto the next frame
clip.gotoAndStop( i );
//get the bounds
bounds = clip.getBounds(clip);
//create a new bitmapdata container
bitmapData = new BitmapData(
transformer.width == -1 ? bounds.width : transformer.width,
transformer.height == -1 ? bounds.height : transformer.height,
transformer.transparent,
transformer.color
);
if (transformer.matrix.tx == 0 && transformer.matrix.ty == 0) transformer.translateToZero( bounds );
//draw the bitmap data with the transformers
bitmapData.draw(
this._source,
transformer.matrix,
transformer.colorTransform,
transformer.blendMode,
transformer.clipRect, //new Rectangle(0, 0, bounds.width, bounds.height),
transformer.smoothing
);
//push the data on the array
frames.push( bitmapData );
}
結果は異なります - http://i42.tinypic.com/lfv52.jpg - 黒いものはラスタライズされたバージョンです(テストするために色変換を使用しました:P)。頭と左の靴に注意してください。誰が問題が何であるか知っていますか?BitmapData コンストラクターで境界ボックスに「余分な」ピクセルを追加する人を見てきましたが、それは正しい解決策です。
キャラクターにうまくフィットする方法を知っている人はいますか?