0
我想使用带有HDividedBox元素的ColorMatrixFilter,以便左右框使图表变为黑色&,但保留中心部分的颜色。在Flex中使用ColorMatrixFilter和HDividedBox
看起来过滤器必须位于AreaChart而不是HDividedBox上,但我想知道是否有方法设置画布来掩盖背后的内容。
我现在的代码如下所示;灰色过滤器没有效果。
<mx:HDividedBox id="dividedBox" horizontalScrollPolicy="off"
width="100%" height="100%"
liveDragging="true" >
<mx:Canvas id="leftBox" backgroundColor="#FFFFFF"
backgroundAlpha="0.5" width="50%"
height="100%" />
<mx:Canvas backgroundColor="#FFFFFF" backgroundAlpha="0"
width="50%" height="100%" buttonMode="true"
mouseDown="setMouseDown(rangeChart);"
minWidth="{rangeDataRatio * 4}"
mouseUp="showAnnotations = true; refreshAnnotations()"/>
<mx:Canvas id="rightBox" backgroundColor="#FFFFFF"
backgroundAlpha="0.5" width="0%" height="100%"
filters="{[greyFilter]}" />
</mx:HDividedBox>
滤波器代码如下:
var greyMatrix:Array = [
1,1,1,0,0,
1,1,1,0,0,
1,1,1,0,0,
0,0,0,1,0 ];
var greyFilter:ColorMatrixFilter =
new ColorMatrixFilter(greyMatrix);