2012-11-08 5 views
0

bitmapdata를 사용하여 드로잉 할 때 알파 및 BlendMode.HardLight를 모두 적용 할 수 있습니까?비트 맵 데이터 블렌드 모드 및 알파

var processImageBmd:BitmapData=new BitmapData(900,900); 
processImageBmd.draw(backgroundImage); //backgroundImage is a sprite        

processImageBmd.draw(frontImage,null,null,BlendMode.HARDLIGHT);//frontImage is a sprite 

는 기본적으로 나는 알파를 적용해야하고 BlendMode.HardLight frontImage에 (의 알파 = 0.4라고하자). 전면 이미지에 혼합 모드 하드 라이트를 적용했지만 알파로 만드는 방법을 알 수 없습니다.

+0

난 당신이 colorTransform이 매개 변수에 알파를 설정할 수 있습니다 믿습니다

그래서 시나리오의 경우,이 트릭을 할해야합니다. 내가 예제를 만들 수 있는지 알게 될 것이다. – BadFeelingAboutThis

+0

나는 당신과 같은 해결책을 찾았다. :) 돌아와서 대답을 보았다. 그래서 나는 나중에 포인트를 주었다. – ForeverNights

답변

1

당신은 draw 함수에 전달되는 colorTransfrom이 작업을 수행 할 수 있어야합니다.

var ct:ColorTransform = frontImage.transform.colorTransform; //copy the current colorTransform so you don't have to mess with colors 
ct.alphaMultiplier = .4; //set it's alpha to .4; 
processImageBmd.draw(frontImage,null,ct,BlendMode.HARDLIGHT); //pass your color transform to the draw command 
1

예, 가능합니다. alphaMultiplier 매개 변수를 포함하는 ColorTransform을 전달해야합니다.

BitmapData.draw(IDrawable, Matrix, ColorTransform, BlendMode, ClipRect, smoothing) 
관련 문제