2010-03-13 4 views
1

저는 지정된 무비 클립의 모든 프레임을 래스터 화하는 MovieClip 래스터 라이저를 작성하고 있습니다. 여기 래스터의 코드는 다음과 같습니다 BitmapData 컷오프

 
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 생성자에서 경계 상자에 '추가'픽셀을 추가하는 것을 보았지만 올바른 해결책은 아닙니다.

누구나 캐릭터에 잘 어울리는 아이디어가 있습니까?

답변

0

transformer.translateToZero()은 무엇을 말하지 않았지만 문자는 항상 (0, 0)으로 정렬되어 있습니까?

나는 당신이 전체 무비 클립 복사하기를 원한다면 당신이 경계로하여 BitmapData.draw()의 clipRect와 인수를 전달해야 의미한다.

+0

translateToZero는 다음을 수행합니다. _matrix.translate (-bounds.x, -bounds.y); // _ matrix = flash.geom.Matrix movieclip의 현재 x 및 y 축을 0으로 반전합니다. BitmapData.draw 메서드의 clipRect에 경계를 전달하면 무비 클립의 1/4이 그려지기 때문에 무비 클립의 1/4이 그려집니다. – Fristi

관련 문제