패키지 | spark.filters |
클래스 | public class ColorMatrixFilter |
상속 | ColorMatrixFilter BaseFilter EventDispatcher Object |
구현 | IBitmapFilter |
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | Flash Player 10, AIR 1.5 |
The <s:ColorMatrixFilter>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:ColorMatrixFilter Properties matrix="[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]" />
기타 예제
관련 API 요소
공용 속성
속성 | 정의 주체 | ||
---|---|---|---|
constructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다. | Object | ||
matrix : Object
A comma delimited list of 20 doubles that comprise a 4x5 matrix applied to the
rendered element. | ColorMatrixFilter |
공용 메서드
메서드 | 정의 주체 | ||
---|---|---|---|
ColorMatrixFilter(matrix:Array = null)
Constructor. | ColorMatrixFilter | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다. | EventDispatcher | ||
Returns a copy of this filter object. | ColorMatrixFilter | ||
이벤트를 이벤트 흐름으로 전달합니다. | EventDispatcher | ||
EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | ||
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | ||
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | ||
Propagates a change event when the filter has changed. | BaseFilter | ||
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | ||
EventDispatcher 객체에서 리스너를 제거합니다. | EventDispatcher | ||
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | ||
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 프리미티브 값을 반환합니다. | Object | ||
이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher |
공용 상수
속성 세부 정보
matrix | 속성 |
matrix:Object
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | Flash Player 10, AIR 1.5 |
A comma delimited list of 20 doubles that comprise a 4x5 matrix applied to the rendered element. The matrix is in row major order -- that is, the first five elements are multipled by the vector [srcR,srcG,srcB,srcA,1] to determine the output red value, the second five determine the output green value, etc.
The value must either be an array or comma delimited string of 20 numbers.
기본값: [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0].
구현
public function get matrix():Object
public function set matrix(value:Object):void
생성자 세부 정보
ColorMatrixFilter | () | 생성자 |
메서드 세부 정보
clone | () | 메서드 |
public function clone():BitmapFilter
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | Flash Player 10, AIR 1.5 |
Returns a copy of this filter object.
반환값BitmapFilter — A new ColorMatrixFilter instance with all of the same
properties as the original one.
|
예제 예제 사용 방법
ColorMatrixFilterExample.mxml
<?xml version="1.0"?> <!-- filters/examples/ColorMatrixFilterExample .mxml --> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" creationComplete="createFilters()"> <fx:Script><![CDATA[ import spark.filters.*; import flash.filters.BitmapFilterQuality; import flash.filters.BitmapFilterType; private var myGreenMatrixFilter:ColorMatrixFilter; private var myBlueMatrixFilter:ColorMatrixFilter; private var myRedMatrixFilter:ColorMatrixFilter; public function createFilters():void { var greenMatrix:Array = new Array(); greenMatrix = greenMatrix.concat([0, 0, 0, 0, 0]); // red greenMatrix = greenMatrix.concat([0, 1, 0, 0, 0]); // green greenMatrix = greenMatrix.concat([0, 0, 0, 0, 0]); // blue greenMatrix = greenMatrix.concat([0, 0, 0, 1, 0]); // alpha var blueMatrix:Array = new Array(); blueMatrix = blueMatrix.concat([0, 0, 0, 0, 0]); // red blueMatrix = blueMatrix.concat([0, 0, 0, 0, 0]); // green blueMatrix = blueMatrix.concat([0, 0, 1, 0, 0]); // blue blueMatrix = blueMatrix.concat([0, 0, 0, 1, 0]); // alpha var redMatrix:Array = new Array(); redMatrix = redMatrix.concat([1, 0, 0, 0, 0]); // red redMatrix = redMatrix.concat([0, 0, 0, 0, 0]); // green redMatrix = redMatrix.concat([0, 0, 0, 0, 0]); // blue redMatrix = redMatrix.concat([0, 0, 0, 1, 0]); // alpha myGreenMatrixFilter = new ColorMatrixFilter(greenMatrix); myBlueMatrixFilter = new ColorMatrixFilter(blueMatrix); myRedMatrixFilter = new ColorMatrixFilter(redMatrix); greenImage.filters = [myGreenMatrixFilter]; blueImage.filters = [myBlueMatrixFilter]; redImage.filters = [myRedMatrixFilter]; } ]]></fx:Script> <s:VGroup> <s:VGroup> <s:Label text="Original Image"/> <mx:Image id="originalImage" source="@Embed(source='assets/Nokia_6630.png')"/> </s:VGroup> <s:VGroup> <s:Label text="Green Matrix Image"/> <mx:Image id="greenImage" source="@Embed(source='assets/Nokia_6630.png')"/> </s:VGroup> <s:VGroup> <s:Label text="Blue Matrix Image"/> <mx:Image id="blueImage" source="@Embed(source='assets/Nokia_6630.png')"/> </s:VGroup> <s:VGroup> <s:Label text="Red Matrix Image"/> <mx:Image id="redImage" source="@Embed(source='assets/Nokia_6630.png')"/> </s:VGroup> </s:VGroup> </s:Application>
Tue Jun 12 2018, 03:17 PM Z